jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/343084 )

Change subject: Use mw prefix on all HelpDialog CSS classes
......................................................................


Use mw prefix on all HelpDialog CSS classes

Change-Id: I2d72da98f78ad77534399a19c0f9e0208fef3af7
---
M modules/ext.TwoColConflict.HelpDialog.js
M tests/qunit/TwoColConflict.HelpDialog.test.js
2 files changed, 9 insertions(+), 10 deletions(-)

Approvals:
  jenkins-bot: Verified
  Andrew-WMDE: Looks good to me, approved



diff --git a/modules/ext.TwoColConflict.HelpDialog.js 
b/modules/ext.TwoColConflict.HelpDialog.js
index 02b9f23..228408a 100644
--- a/modules/ext.TwoColConflict.HelpDialog.js
+++ b/modules/ext.TwoColConflict.HelpDialog.js
@@ -54,7 +54,7 @@
                 * @return {string}
                 */
                getCssPrefix: function () {
-                       return this.config.name.toLowerCase();
+                       return 'mw-' + this.config.name.toLowerCase();
                },
 
                /**
@@ -71,12 +71,12 @@
                        slide.$element
                                .append(
                                        $( '<div>' ).addClass(
-                                               'mw-' + this.getCssPrefix() +
+                                               this.getCssPrefix() +
                                                '-help-dialog-image-' + 
imageMode + ' ' + imageClass
                                        )
                                )
                                .append(
-                                       $( '<p>' ).addClass( 'mw-' + 
this.getCssPrefix() + '-help-dialog-text' )
+                                       $( '<p>' ).addClass( 
this.getCssPrefix() + '-help-dialog-text' )
                                                .html( mw.message( message 
).parse() )
                                );
 
@@ -131,12 +131,12 @@
         */
        HelpDialog.init = function ( config ) {
                var windowManager = new OO.ui.WindowManager(),
-                       dialog;
+                       dialog = new HelpDialog( config );
 
                $( 'body' )
                        .append( windowManager.$element )
                        .click( function ( event ) {
-                               if ( $( event.target ).hasClass( 
config.name.toLowerCase() + '-help-dialog' ) ) {
+                               if ( $( event.target ).hasClass( 
dialog.getCssPrefix() + '-help-dialog' ) ) {
                                        HelpDialog.hide();
                                }
                        } );
@@ -149,14 +149,12 @@
                                label: mw.msg( config.next ),
                                flags: [ 'primary', 'progressive' ],
                                modes: [ 'initial', 'middle' ],
-                               classes: [ config.name.toLowerCase() + 
'-help-next' ]
+                               classes: [ dialog.getCssPrefix() + '-help-next' 
]
                        },
                        { action: 'previous', flags: 'safe', label: mw.msg( 
config.prev ), modes: [ 'middle', 'last' ], classes: [ config.name + 
'-help-previous' ] },
-                       { label: mw.msg( config.close ), flags: 'safe', modes: 
'initial', classes: [ config.name.toLowerCase() + '-help-close-start' ] },
-                       { label: mw.msg( config.close ), flags: 'primary', 
modes: 'last', classes: [ config.name.toLowerCase() + '-help-close-end' ] }
+                       { label: mw.msg( config.close ), flags: 'safe', modes: 
'initial', classes: [ dialog.getCssPrefix() + '-help-close-start' ] },
+                       { label: mw.msg( config.close ), flags: 'primary', 
modes: 'last', classes: [ dialog.getCssPrefix() + '-help-close-end' ] }
                ];
-
-               dialog = new HelpDialog( config );
 
                HelpDialog.show = function () {
                        if ( !windowManager.hasWindow( dialog ) ) {
diff --git a/tests/qunit/TwoColConflict.HelpDialog.test.js 
b/tests/qunit/TwoColConflict.HelpDialog.test.js
index 2e76215..10b64ac 100644
--- a/tests/qunit/TwoColConflict.HelpDialog.test.js
+++ b/tests/qunit/TwoColConflict.HelpDialog.test.js
@@ -69,6 +69,7 @@
                        getSlideTextHtml( dialog.slides[ 3 ] ),
                        addLinkTargets( mw.message( 
'twoColConflict-help-dialog-slide4' ).parse() )
                );
+               assert.equal( dialog.getCssPrefix(), 'mw-twocolconflict' );
                assert.ok( dialog.slides[ 0 ].$element.find( 'div' ).hasClass( 
'mw-twocolconflict-help-dialog-slide-1' ) );
                assert.ok( dialog.slides[ 1 ].$element.find( 'div' ).hasClass( 
'mw-twocolconflict-help-dialog-slide-2' ) );
                assert.ok( dialog.slides[ 2 ].$element.find( 'div' ).hasClass( 
'mw-twocolconflict-help-dialog-slide-3' ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/343084
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d72da98f78ad77534399a19c0f9e0208fef3af7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Andrew-WMDE <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to