RCFilters: Don't empty the changes list on first load
authorMoriel Schottlender <moriel@gmail.com>
Fri, 21 Jul 2017 21:50:30 +0000 (14:50 -0700)
committerMoriel Schottlender <moriel@gmail.com>
Fri, 21 Jul 2017 21:50:30 +0000 (14:50 -0700)
jQuery.empty() apparently also unattaches event handlers.
Only empty before we re-append if we are not in the first
load of the changes list.

Bug: T171085
Change-Id: I68754e99a6c5c821be47b1b1e8e22f23db85746c

resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js

index 6512f04..0e9e843 100644 (file)
                        this.$element.append( $message );
                } else {
                        this.$changesListContent = $changesListContent;
-                       this.$element.empty().append( this.$changesListContent );
+                       if ( !isInitialDOM ) {
+                               this.$element.empty().append( this.$changesListContent );
+                       }
                        // Set up highlight containers
                        this.setupHighlightContainers( this.$element );