From 2adf9e8634b4336002d2bcc39e22ffe0387239d4 Mon Sep 17 00:00:00 2001 From: Carlos Lizaga <carlos.lizaga@pronovias.com> Date: Thu, 23 Nov 2017 17:19:58 +0100 Subject: [PATCH] Fixed unsafe comparison with a literal. No need to eslint eqeqeq. Fixed enable method. It was not enabling and activating the collapsible. This was detected on Jasmine unit testing. Minor repositioning to this.options.disabled on disable method for consistency purposes with enable method. --- lib/web/mage/collapsible.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/web/mage/collapsible.js b/lib/web/mage/collapsible.js index 0d8cf836c19..49624fbeb15 100644 --- a/lib/web/mage/collapsible.js +++ b/lib/web/mage/collapsible.js @@ -243,7 +243,7 @@ define([ }); // For collapsible widget only (not tabs or accordion) - if (this.header.parent().attr('role') != 'presentation') { //eslint-disable-line eqeqeq + if (this.header.parent().attr('role') !== 'presentation') { this.header .parent() .attr('role', 'tablist'); @@ -316,9 +316,9 @@ define([ * Disable. */ disable: function () { + this.options.disabled = true; this._off(this.trigger); this.forceDeactivate(); - this.options.disabled = true; if (this.options.disabledState) { this.element.addClass(this.options.disabledState); @@ -330,12 +330,14 @@ define([ * Enable. */ enable: function () { - this._on(this.trigger, this.events); this.options.disabled = false; + this._on(this.trigger, this.events); + this.forceActivate(); if (this.options.disabledState) { this.element.removeClass(this.options.disabledState); } + this.trigger.attr('tabIndex', 0); }, /** -- GitLab