From 620d14d01365a1907f4abc19b3c50882aef86c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gheolt=CC=A6an?= Date: Sun, 14 Oct 2018 18:29:29 +0300 Subject: [PATCH 1/2] Binding to event collapsible scroll --- lib/web/mage/collapsible.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/web/mage/collapsible.js b/lib/web/mage/collapsible.js index 69e576bba604a..a6a1dcde6c87a 100644 --- a/lib/web/mage/collapsible.js +++ b/lib/web/mage/collapsible.js @@ -63,6 +63,12 @@ define([ this.icons = true; } + this.element.on('dimensionsChanged',function(e) { + if(e.target && e.target.classList.contains('active')) { + this._scrollToTopIfVisible(e.target); + } + }.bind(this)); + this._bind('click'); this._trigger('created'); }, @@ -453,9 +459,6 @@ define([ if (this.options.animate) { this._animate(showProps); } else { - if (this.content.length) { - this._scrollToTopIfVisible(this.content.get(0).parentElement); - } this.content.show(); } this._open(); From 087257703657d85bf06a9cf78f9efc80151389eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gheolt=CC=A6an?= Date: Sun, 14 Oct 2018 18:45:52 +0300 Subject: [PATCH 2/2] Binding to event collapsible scroll --- lib/web/mage/collapsible.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/mage/collapsible.js b/lib/web/mage/collapsible.js index a6a1dcde6c87a..3d283d102e323 100644 --- a/lib/web/mage/collapsible.js +++ b/lib/web/mage/collapsible.js @@ -63,8 +63,8 @@ define([ this.icons = true; } - this.element.on('dimensionsChanged',function(e) { - if(e.target && e.target.classList.contains('active')) { + this.element.on('dimensionsChanged', function (e) { + if (e.target && e.target.classList.contains('active')) { this._scrollToTopIfVisible(e.target); } }.bind(this));