Skip to content

Commit 4a4bce2

Browse files
author
Hwashiang Yu
committed
MAGETWO-94807: Shop By button is not working in a mobile theme
- Updated logic to not call parentElement on empty object - Updated activate logic to exit upon options disabled - Updated docBlock to have return value of void
1 parent b55989d commit 4a4bce2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

lib/web/mage/collapsible.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,17 +442,23 @@ define([
442442

443443
/**
444444
* Activate.
445+
*
446+
* @return void;
445447
*/
446448
activate: function () {
447-
if (!this.options.disabled) {
448-
if (this.options.animate) {
449-
this._animate(showProps);
450-
} else {
449+
if (this.options.disabled) {
450+
return;
451+
}
452+
453+
if (this.options.animate) {
454+
this._animate(showProps);
455+
} else {
456+
if (this.content.length) {
451457
this._scrollToTopIfVisible(this.content.get(0).parentElement);
452-
this.content.show();
453458
}
454-
this._open();
459+
this.content.show();
455460
}
461+
this._open();
456462
},
457463

458464
/**

0 commit comments

Comments
 (0)