[MediaWiki-commits] [Gerrit] Hygiene: Simplify main menu button selectors - change (mediawiki...MobileFrontend)
jenkins-bot has submitted this change and it was merged. Change subject: Hygiene: Simplify main menu button selectors .. Hygiene: Simplify main menu button selectors Change-Id: I1790eb7438182356ad62b840efe2d3fef169fa49 --- M includes/skins/SkinMinerva.php M includes/skins/header.mustache M resources/mobile.head/init.js M resources/mobile.mainMenu/MainMenu.js M resources/mobile.startup/Skin.js 5 files changed, 9 insertions(+), 13 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index e04e52c..b036d54 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -731,7 +731,7 @@ Html::element( 'a', array( 'title' = $this-msg( 'mobile-frontend-main-menu-button-tooltip' ), 'href' = $url, - 'class' = MobileUI::iconClass( 'mainmenu' ), + 'class' = MobileUI::iconClass( 'mainmenu', 'element', 'main-menu-button' ), 'id'= 'mw-mf-main-menu-button', ), $this-msg( 'mobile-frontend-main-menu-button-tooltip' ) ) ); diff --git a/includes/skins/header.mustache b/includes/skins/header.mustache index 5aff8e2..0ea85a9 100644 --- a/includes/skins/header.mustache +++ b/includes/skins/header.mustache @@ -1,8 +1,8 @@ div - a class={{mobileMenuClass}} href={{mobileMenuLink}}{{mobileMenuTitle}}/a + a class={{mobileMenuClass}} main-menu-button href={{mobileMenuLink}}{{mobileMenuTitle}}/a /div div class=header-title - a href={{mobileMenuLink}}{{{siteName}}}/a + a href={{mobileMenuLink}} class=main-menu-button{{{siteName}}}/a /div div {{{secondaryButton}}} diff --git a/resources/mobile.head/init.js b/resources/mobile.head/init.js index 2d87ed9..d9c6b37 100644 --- a/resources/mobile.head/init.js +++ b/resources/mobile.head/init.js @@ -80,9 +80,8 @@ M.on( 'history-link-loaded', initHistoryLink ); M.on( 'header-loaded', function () { // Render MainMenu when needed - // In alpha there is no #mw-mf-main-menu-button, the user can click on the header - // search icon or the site name in the header to open the main menu - $( '#mw-mf-main-menu-button, .alpha .header a.header-icon, .alpha .header .header-title a' ) + // FIXME: remove #mw-mf-main-menu-button when cache clears + $( '#mw-mf-main-menu-button, .header .main-menu-button' ) .on( 'click', function ( ev ) { mainMenu.openNavigationDrawer(); ev.preventDefault(); diff --git a/resources/mobile.mainMenu/MainMenu.js b/resources/mobile.mainMenu/MainMenu.js index 20bbc61..666977c 100644 --- a/resources/mobile.mainMenu/MainMenu.js +++ b/resources/mobile.mainMenu/MainMenu.js @@ -86,9 +86,8 @@ // FIXME: Remove when cache clears https://phabricator.wikimedia.org/T102868 this.$el.addClass( 'view-border-box' ); // Listen to the main menu button clicks - // In alpha there is no #mw-mf-main-menu-button, the user can click on the header - // search icon or the site name in the header to open the main menu - $( '#mw-mf-main-menu-button, .alpha .header a.header-icon, .alpha .header .header-title a' ) + // FIXME: remove #mw-mf-main-menu-button when cache clears + $( '#mw-mf-main-menu-button, .header .main-menu-button' ) .off( 'click' ) .on( 'click', function ( ev ) { if ( self.isOpen() ) { diff --git a/resources/mobile.startup/Skin.js b/resources/mobile.startup/Skin.js index 11711fe..7e83529 100644 --- a/resources/mobile.startup/Skin.js +++ b/resources/mobile.startup/Skin.js @@ -42,11 +42,9 @@ // Make sure the menu is open and we are not clicking on the menu button if ( this.mainMenu.isOpen() - // stable and beta + // FIXME: remove the ID comparison when cache clears ev.target.id !== 'mw-mf-main-menu-button' - // alpha header icon and header title links, which open the menu - $target.get( 0 ) !== $( '.alpha .header a.header-icon' ).get( 0 ) - $target.get( 0 ) !== $( '.alpha .header .header-title a' ).get( 0 ) + !$target.hasClass( 'main-menu-button' )
[MediaWiki-commits] [Gerrit] Hygiene: Simplify main menu button selectors - change (mediawiki...MobileFrontend)
Bmansurov has uploaded a new change for review. https://gerrit.wikimedia.org/r/219479 Change subject: Hygiene: Simplify main menu button selectors .. Hygiene: Simplify main menu button selectors Change-Id: I1790eb7438182356ad62b840efe2d3fef169fa49 --- M includes/skins/SkinMinerva.php M includes/skins/header.mustache M resources/mobile.head/init.js M resources/mobile.mainMenu/MainMenu.js M resources/mobile.startup/Skin.js 5 files changed, 8 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/79/219479/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index e04e52c..b036d54 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -731,7 +731,7 @@ Html::element( 'a', array( 'title' = $this-msg( 'mobile-frontend-main-menu-button-tooltip' ), 'href' = $url, - 'class' = MobileUI::iconClass( 'mainmenu' ), + 'class' = MobileUI::iconClass( 'mainmenu', 'element', 'main-menu-button' ), 'id'= 'mw-mf-main-menu-button', ), $this-msg( 'mobile-frontend-main-menu-button-tooltip' ) ) ); diff --git a/includes/skins/header.mustache b/includes/skins/header.mustache index 5aff8e2..0ea85a9 100644 --- a/includes/skins/header.mustache +++ b/includes/skins/header.mustache @@ -1,8 +1,8 @@ div - a class={{mobileMenuClass}} href={{mobileMenuLink}}{{mobileMenuTitle}}/a + a class={{mobileMenuClass}} main-menu-button href={{mobileMenuLink}}{{mobileMenuTitle}}/a /div div class=header-title - a href={{mobileMenuLink}}{{{siteName}}}/a + a href={{mobileMenuLink}} class=main-menu-button{{{siteName}}}/a /div div {{{secondaryButton}}} diff --git a/resources/mobile.head/init.js b/resources/mobile.head/init.js index 2d87ed9..b0c1338 100644 --- a/resources/mobile.head/init.js +++ b/resources/mobile.head/init.js @@ -80,9 +80,8 @@ M.on( 'history-link-loaded', initHistoryLink ); M.on( 'header-loaded', function () { // Render MainMenu when needed - // In alpha there is no #mw-mf-main-menu-button, the user can click on the header - // search icon or the site name in the header to open the main menu - $( '#mw-mf-main-menu-button, .alpha .header a.header-icon, .alpha .header .header-title a' ) + // FIXME: remove #mw-mf-main-menu-button when cache clears + $( '#mw-mf-main-menu-button, .main-menu-button' ) .on( 'click', function ( ev ) { mainMenu.openNavigationDrawer(); ev.preventDefault(); diff --git a/resources/mobile.mainMenu/MainMenu.js b/resources/mobile.mainMenu/MainMenu.js index 20bbc61..3d57148 100644 --- a/resources/mobile.mainMenu/MainMenu.js +++ b/resources/mobile.mainMenu/MainMenu.js @@ -86,9 +86,8 @@ // FIXME: Remove when cache clears https://phabricator.wikimedia.org/T102868 this.$el.addClass( 'view-border-box' ); // Listen to the main menu button clicks - // In alpha there is no #mw-mf-main-menu-button, the user can click on the header - // search icon or the site name in the header to open the main menu - $( '#mw-mf-main-menu-button, .alpha .header a.header-icon, .alpha .header .header-title a' ) + // FIXME: remove #mw-mf-main-menu-button when cache clears + $( '#mw-mf-main-menu-button, .main-menu-button' ) .off( 'click' ) .on( 'click', function ( ev ) { if ( self.isOpen() ) { diff --git a/resources/mobile.startup/Skin.js b/resources/mobile.startup/Skin.js index 11711fe..06922e8 100644 --- a/resources/mobile.startup/Skin.js +++ b/resources/mobile.startup/Skin.js @@ -42,11 +42,7 @@ // Make sure the menu is open and we are not clicking on the menu button if ( this.mainMenu.isOpen() - // stable and beta - ev.target.id !== 'mw-mf-main-menu-button' - // alpha header icon and header title links, which open the menu - $target.get( 0 ) !== $( '.alpha .header a.header-icon' ).get( 0 ) - $target.get( 0 ) !== $( '.alpha .header .header-title a' ).get( 0 ) + !$target.hasClass( 'main-menu-button' ) ) {