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

Change subject: Avoid global access of elements outside Views
......................................................................


Avoid global access of elements outside Views

FontChanger should not
have access to elements outside of its world.

Bug: T173981
Change-Id: Ic51bb7ae895f61ebfa6b4041ad60ea14a2560da0
---
M resources/mobile.special.mobileoptions.scripts.fontchanger/FontChanger.js
M resources/mobile.special.mobileoptions.scripts.fontchanger/init.js
2 files changed, 3 insertions(+), 5 deletions(-)

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



diff --git 
a/resources/mobile.special.mobileoptions.scripts.fontchanger/FontChanger.js 
b/resources/mobile.special.mobileoptions.scripts.fontchanger/FontChanger.js
index f93cdef..857d643 100644
--- a/resources/mobile.special.mobileoptions.scripts.fontchanger/FontChanger.js
+++ b/resources/mobile.special.mobileoptions.scripts.fontchanger/FontChanger.js
@@ -1,4 +1,4 @@
-( function ( M, $ ) {
+( function ( M ) {
        var View = M.require( 'mobile.startup/View' ),
                Button = M.require( 'mobile.startup/Button' );
 
@@ -71,9 +71,6 @@
                                self.setPercentage( parseInt( 
self.fontchanger.val() ) + 10 );
                                return false;
                        } );
-                       // FIXME: This should be an event and bound inside
-                       // 
resources/mobile.special.mobileoptions.scripts.fontchanger/init.js
-                       $( 'form.mw-mf-settings' ).on( 'submit', $.proxy( this, 
'save' ) );
                },
 
                /**
@@ -92,4 +89,4 @@
 
        M.define( 'mobile.fontchanger/FontChanger', FontChanger );
 
-}( mw.mobileFrontend, jQuery ) );
+}( mw.mobileFrontend ) );
diff --git a/resources/mobile.special.mobileoptions.scripts.fontchanger/init.js 
b/resources/mobile.special.mobileoptions.scripts.fontchanger/init.js
index 847753b..0bd5262 100644
--- a/resources/mobile.special.mobileoptions.scripts.fontchanger/init.js
+++ b/resources/mobile.special.mobileoptions.scripts.fontchanger/init.js
@@ -10,5 +10,6 @@
                        } );
 
                fontChanger.insertBefore( saveLI );
+               $( 'form.mw-mf-settings' ).on( 'submit', fontChanger.save.bind( 
fontChanger ) );
        } );
 }( mw.mobileFrontend, jQuery ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic51bb7ae895f61ebfa6b4041ad60ea14a2560da0
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Pmiazga <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to