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 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits