Merge "RCFilters: Add range group filters - limit, days and hours"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FormWrapperWidget.js
index 6004e25..0abaff2 100644 (file)
         *
         * @param {jQuery|string} $changesList Updated changes list
         * @param {jQuery} $fieldset Updated fieldset
+        * @param {boolean} isInitialDOM Whether $changesListContent is the existing (already attached) DOM
         */
-       mw.rcfilters.ui.FormWrapperWidget.prototype.onChangesModelUpdate = function ( $changesList, $fieldset ) {
+       mw.rcfilters.ui.FormWrapperWidget.prototype.onChangesModelUpdate = function ( $changesList, $fieldset, isInitialDOM ) {
                this.$submitButton.prop( 'disabled', false );
 
                // Replace the entire fieldset
                this.$element.empty().append( $fieldset.contents() );
-               // Make sure enhanced RC re-initializes correctly
-               mw.hook( 'wikipage.content' ).fire( this.$element );
+
+               if ( !isInitialDOM ) {
+                       // Make sure enhanced RC re-initializes correctly
+                       mw.hook( 'wikipage.content' ).fire( this.$element );
+               }
 
                this.cleanUpFieldset();