Merge "OOjs UI: Fix #gatherPreInfuseState called incorrectly, causing TypeErrors"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 25 Feb 2016 15:48:55 +0000 (15:48 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 25 Feb 2016 15:48:55 +0000 (15:48 +0000)
resources/lib/oojs-ui/oojs-ui-core.js

index e244037..67d3c02 100644 (file)
@@ -610,13 +610,13 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) {
                }
                if ( domPromise ) {
                        // pick up dynamic state, like focus, value of form inputs, scroll position, etc.
-                       state = data.gatherPreInfuseState( $elem );
+                       state = data.constructor.static.gatherPreInfuseState( $elem, data );
                        // restore dynamic state after the new element is re-inserted into DOM under infused parent
                        domPromise.done( data.restorePreInfuseState.bind( data, state ) );
                        infusedChildren = $elem.data( 'ooui-infused-children' );
                        if ( infusedChildren && infusedChildren.length ) {
                                infusedChildren.forEach( function ( data ) {
-                                       var state = data.gatherPreInfuseState( $elem );
+                                       var state = data.constructor.static.gatherPreInfuseState( $elem, data );
                                        domPromise.done( data.restorePreInfuseState.bind( data, state ) );
                                } );
                        }