Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/206335
Change subject: Hygiene: Drawer uses Icon and Button
......................................................................
Hygiene: Drawer uses Icon and Button
Change-Id: I2ab45765139567ebf57c8ec2cb57d24676e1a0bd
---
M javascripts/CtaDrawer.js
M templates/ctaDrawer.hogan
2 files changed, 14 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/35/206335/1
diff --git a/javascripts/CtaDrawer.js b/javascripts/CtaDrawer.js
index 78539b9..ad50534 100644
--- a/javascripts/CtaDrawer.js
+++ b/javascripts/CtaDrawer.js
@@ -1,6 +1,7 @@
( function ( M, $ ) {
var Drawer = M.require( 'Drawer' ),
Icon = M.require( 'Icon' ),
+ Button = M.require( 'Button' ),
Anchor = M.require( 'Anchor' ),
CtaDrawer;
@@ -10,6 +11,9 @@
* with options to log in or sign up for a new account.
* @class CtaDrawer
* @extends Drawer
+ * @uses Button
+ * @uses Icon
+ * @uses Anchor
*/
CtaDrawer = Drawer.extend( {
/**
@@ -19,6 +23,10 @@
* @cfg {String} defaults.signup Caption for the signup button.
*/
defaults: {
+ loginButton: new Button( {
+ progressive: true,
+ label: mw.msg(
'mobile-frontend-watchlist-cta-button-login' )
+ } ).options,
signupAnchor: new Anchor( {
progressive: true,
label: mw.msg(
'mobile-frontend-watchlist-cta-button-signup' )
@@ -26,10 +34,11 @@
collapseButton: new Icon( {
name: 'arrow-down',
additionalClassNames: 'cancel'
- } ).toHtmlString(),
- loginCaption: mw.msg(
'mobile-frontend-watchlist-cta-button-login' )
+ } ).options
},
templatePartials: {
+ icon: Icon.prototype.template,
+ button: Button.prototype.template,
anchor: Anchor.prototype.template
},
template: mw.template.get( 'mobile.drawers', 'Cta.hogan' ),
@@ -44,7 +53,7 @@
type: 'signup'
}, options.signupQueryParams );
- options.loginUrl = mw.util.getUrl( 'Special:UserLogin',
params );
+ options.loginButton.href = mw.util.getUrl(
'Special:UserLogin', params );
options.signupAnchor.href = mw.util.getUrl(
'Special:UserLogin', $.extend( params, signupParams ) );
}
} );
diff --git a/templates/ctaDrawer.hogan b/templates/ctaDrawer.hogan
index 36684ee..a1e66c7 100644
--- a/templates/ctaDrawer.hogan
+++ b/templates/ctaDrawer.hogan
@@ -1,6 +1,6 @@
-{{{collapseButton}}}
+{{#collapseButton}}{{>icon}}{{/collapseButton}}
<p>{{content}}</p>
-<a class="mw-ui-button mw-ui-progressive"
href="{{loginUrl}}">{{loginCaption}}</a>
+{{#loginButton}}{{>button}}{{/loginButton}}
<div>
{{#signupAnchor}}{{>anchor}}{{/signupAnchor}}
</div>
--
To view, visit https://gerrit.wikimedia.org/r/206335
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ab45765139567ebf57c8ec2cb57d24676e1a0bd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits