From f1786b2b21f0f76a3b5d59d04c88ec0455514d87 Mon Sep 17 00:00:00 2001 From: jk Date: Tue, 11 Apr 2017 20:25:57 +0200 Subject: [PATCH] fixes mutateme.zf.trigger fires as often as many submenu you got because it's in the _events($elem) function, and this gets bound as manu times you got submenues. i'got a menu with 92 submenu's and wondered why the performance is so weak on clicking on the responsiveToggle, so i started searching an found that the mutateme event gets fired as many times as there are submenus, and on the drilldown then 92 times the _getMaxDims was executedthis calcs the heights and so on and is very performant, so i debugged it an moved it to the _registerEvents function big performance improvement --- js/foundation.drilldown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index 3e5f72da4..2f9800a70 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -153,7 +153,6 @@ class Drilldown { }); } }); - this.$element.on('mutateme.zf.trigger', this._resize.bind(this)); } /** @@ -166,6 +165,7 @@ class Drilldown { this._bindHandler = this._scrollTop.bind(this); this.$element.on('open.zf.drilldown hide.zf.drilldown closed.zf.drilldown',this._bindHandler); } + this.$element.on('mutateme.zf.trigger', this._resize.bind(this)); } /** -- 2.47.2