diff --git a/modules/ext.RevisionSlider.DiffPage.js b/modules/ext.RevisionSlider.DiffPage.js index 2f5058e4..3ea16e40 100644 --- a/modules/ext.RevisionSlider.DiffPage.js +++ b/modules/ext.RevisionSlider.DiffPage.js @@ -75,9 +75,9 @@ $.extend( DiffPage.prototype, { self.addHandlersToCoreLinks( sliderView ); + // Re-trigger existing, stable core hooks under the same circumstances as in core mw.hook( 'wikipage.content' ).fire( $contentText ); mw.hook( 'wikipage.diff' ).fire( $( document.body ).find( 'table.diff' ) ); - }, function ( xhr ) { $( 'table.diff[data-mw="interface"]' ).removeClass( 'mw-revslider-diff-loading' ); if ( xhr.statusText !== 'abort' ) { diff --git a/modules/ext.RevisionSlider.PointerLine.js b/modules/ext.RevisionSlider.PointerLine.js index 0d22b12c..2f2c607d 100644 --- a/modules/ext.RevisionSlider.PointerLine.js +++ b/modules/ext.RevisionSlider.PointerLine.js @@ -149,45 +149,12 @@ $.extend( PointerLine.prototype, { ); }, - /** - * Adds colored top-borders for the diff columns fitting the line colors between pointers and columns - * - * @param {boolean} [show=true] - * @private - */ - addColoredColumnBorders: function ( show ) { - show = show !== false; - $( '#mw-diff-otitle1' ).toggleClass( 'mw-revslider-older-diff-column', show ); - $( '#mw-diff-ntitle1' ).toggleClass( 'mw-revslider-newer-diff-column', show ); - }, - - /** - * Remove colored top-borders for the diff columns fitting the line colors between pointers and columns - * - * @private - */ - removeColoredColumnBorders: function () { - this.addColoredColumnBorders( false ); - }, - - /** - * Sets the hooks to draw the column borders - * - * @private - */ - setColumnBorderHooks: function () { - mw.hook( 'wikipage.diff' ).add( this.addColoredColumnBorders ); - mw.hook( 'revslider.expand' ).add( this.addColoredColumnBorders ); - mw.hook( 'revslider.collapse' ).add( this.removeColoredColumnBorders.bind( this ) ); - }, - /** * @return {jQuery} */ getElement: function () { if ( !this.$html ) { this.initialize(); - this.setColumnBorderHooks(); } return this.$html; } diff --git a/modules/ext.RevisionSlider.init.js b/modules/ext.RevisionSlider.init.js index 29b310de..4c798927 100644 --- a/modules/ext.RevisionSlider.init.js +++ b/modules/ext.RevisionSlider.init.js @@ -141,11 +141,9 @@ toggleButton.connect( this, { if ( expanded ) { expand(); mw.track( 'counter.MediaWiki.RevisionSlider.event.expand' ); - mw.hook( 'revslider.expand' ).fire(); } else { collapse(); mw.track( 'counter.MediaWiki.RevisionSlider.event.collapse' ); - mw.hook( 'revslider.collapse' ).fire(); } } } );