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 <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to