[MediaWiki-commits] [Gerrit] Initialise dir property and use a getter - change (oojs/ui)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/152039 Change subject: Initialise dir property and use a getter .. Initialise dir property and use a getter Change-Id: Ie228855430c29ac720b56e241801f318b1e979f7 --- M src/Frame.js 1 file changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/39/152039/1 diff --git a/src/Frame.js b/src/Frame.js index 8ee589b..23a3aac 100644 --- a/src/Frame.js +++ b/src/Frame.js @@ -18,6 +18,7 @@ // Properties this.loading = null; this.config = config; + this.dir = null; // Initialize this.$element @@ -191,7 +192,7 @@ win = this.$element.prop( 'contentWindow' ); doc = win.document; - // Figure out directionality: + // Cache directionality this.dir = OO.ui.Element.getDir( this.$element ) || 'ltr'; // Initialize contents @@ -202,7 +203,7 @@ doc.write( '!doctype html' + 'html' + - 'body class=oo-ui-frame-content oo-ui-' + this.dir + ' dir=' + this.dir + '' + + 'body class=oo-ui-frame-content oo-ui-' + this.getDir() + ' dir=' + this.getDir() + '' + '/body' + '/html' ); @@ -234,3 +235,12 @@ this.$element.css( { width: width, height: height } ); return this; }; + +/** + * Get the directionality of the frame + * + * @return {string} Directionality, 'ltr' or 'rtl' + */ +OO.ui.Frame.prototype.getDir = function () { + return this.dir; +}; -- To view, visit https://gerrit.wikimedia.org/r/152039 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie228855430c29ac720b56e241801f318b1e979f7 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Esanders esand...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Initialise dir property and use a getter - change (oojs/ui)
jenkins-bot has submitted this change and it was merged. Change subject: Initialise dir property and use a getter .. Initialise dir property and use a getter Change-Id: Ie228855430c29ac720b56e241801f318b1e979f7 --- M src/Frame.js 1 file changed, 12 insertions(+), 2 deletions(-) Approvals: Mooeypoo: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Frame.js b/src/Frame.js index 8ee589b..23a3aac 100644 --- a/src/Frame.js +++ b/src/Frame.js @@ -18,6 +18,7 @@ // Properties this.loading = null; this.config = config; + this.dir = null; // Initialize this.$element @@ -191,7 +192,7 @@ win = this.$element.prop( 'contentWindow' ); doc = win.document; - // Figure out directionality: + // Cache directionality this.dir = OO.ui.Element.getDir( this.$element ) || 'ltr'; // Initialize contents @@ -202,7 +203,7 @@ doc.write( '!doctype html' + 'html' + - 'body class=oo-ui-frame-content oo-ui-' + this.dir + ' dir=' + this.dir + '' + + 'body class=oo-ui-frame-content oo-ui-' + this.getDir() + ' dir=' + this.getDir() + '' + '/body' + '/html' ); @@ -234,3 +235,12 @@ this.$element.css( { width: width, height: height } ); return this; }; + +/** + * Get the directionality of the frame + * + * @return {string} Directionality, 'ltr' or 'rtl' + */ +OO.ui.Frame.prototype.getDir = function () { + return this.dir; +}; -- To view, visit https://gerrit.wikimedia.org/r/152039 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie228855430c29ac720b56e241801f318b1e979f7 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Esanders esand...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Mooeypoo mor...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits