Skip to content

Commit

Permalink
Do not upgrade the dom each time we insert a select widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril Ferlicot committed Jan 6, 2017
1 parent 03aefb3 commit 59c2534
Showing 1 changed file with 3 additions and 1 deletion.
@@ -1,3 +1,5 @@
javascript
selectInitJsScriptFor: anId
^ 'getmdlSelect.init("#' , anId , '"); document.addEventListener("DOMNodeInserted", function (ev) { componentHandler.upgradeDom(); }, false);'
^ 'getmdlSelect.init("#' , anId , '");'
" this ->'document.addEventListener('DOMNodeInserted', function (ev) { componentHandler.upgradeDom(); }, false);' must never add. It's bad pratice.
Launch yourself componentHandler.upgradeDom() OR add ONLY ONE TIME at the document this eventListener"

0 comments on commit 59c2534

Please sign in to comment.