Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/230299
Change subject: Use Button to create buttons ...................................................................... Use Button to create buttons Instead of hardcoded ones. Bug: T97094 Change-Id: Id8ab51380f287c62b4e10af283162f32bacae780 --- M resources/mobile.fontchanger/FontChanger.hogan M resources/mobile.fontchanger/FontChanger.js 2 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/99/230299/1 diff --git a/resources/mobile.fontchanger/FontChanger.hogan b/resources/mobile.fontchanger/FontChanger.hogan index c4bf269..f52509b 100644 --- a/resources/mobile.fontchanger/FontChanger.hogan +++ b/resources/mobile.fontchanger/FontChanger.hogan @@ -1,8 +1,8 @@ <span class="fontchanger enableMessage">{{enableMsg}}</span> <div class="mobileoption fontchanger"> - <button class="mw-ui-button mw-ui-progressive fontchanger minus">-</button> - <button class="mw-ui-button fontchanger-value">100%</button> - <button class="mw-ui-button mw-ui-progressive fontchanger plus">+</button> + {{#minusButton}}{{>button}}{{/minusButton}} + {{#valueButton}}{{>button}}{{/valueButton}} + {{#plusButton}}{{>button}}{{/plusButton}} <div class="option-description"> {{descriptionMsg}} </div> diff --git a/resources/mobile.fontchanger/FontChanger.js b/resources/mobile.fontchanger/FontChanger.js index fa580dd..44e510b 100644 --- a/resources/mobile.fontchanger/FontChanger.js +++ b/resources/mobile.fontchanger/FontChanger.js @@ -1,6 +1,7 @@ ( function ( M, $ ) { var FontChanger, View = M.require( 'View' ), + Button = M.require( 'Button' ); settings = M.require( 'settings' ); /** @@ -9,8 +10,32 @@ * @extends View */ FontChanger = View.extend( { + /** + * @cfg {Object} defaults Default options hash. + * @cfg {Object} defaults.viewLink Anchor options for a link to wikidata page. + */ + defaults: { + plusButton: new Button( { + progressive: true, + additionalClassNames: 'fontchanger plus', + label: '+' + } ).options, + minusButton: new Button( { + progressive: true, + additionalClassNames: 'fontchanger minus', + label: '-' + } ).options, + valueButton: new Button( { + additionalClassNames: 'fontchanger-value', + label: '100%' + } ).options + }, /** @inheritdoc */ template: mw.template.get( 'mobile.fontchanger', 'FontChanger.hogan' ), + /** @inheritdoc */ + templatePartials: { + button: Button.prototype.template + }, /** * Save the actual font size setting. * @method -- To view, visit https://gerrit.wikimedia.org/r/230299 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8ab51380f287c62b4e10af283162f32bacae780 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits