Merge branch 'MDL-51719-master' of git://github.com/danpoltawski/moodle
[moodle.git] / lib / editor / atto / plugins / rtl / yui / src / button / js / button.js
index a755c35..724c21d 100644 (file)
@@ -65,7 +65,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
      */
     _toggleRTL: function(e, direction) {
         var host = this.get('host'),
-            sourceSelection = rangy.saveSelection(),
+            sourceSelection = window.rangy.saveSelection(),
             selection = host.getSelection(),
             newDirection = {
                 rtl: 'ltr',
@@ -84,7 +84,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
             }
 
             // Change selection from the containing paragraph to the original one.
-            rangy.restoreSelection(sourceSelection);
+            window.rangy.restoreSelection(sourceSelection);
             // Mark the text as having been updated.
             this.markUpdated();
         }