Merge branch 'MDL-41238-master' of git://github.com/phalacee/moodle
authorSam Hemelryk <sam@moodle.com>
Tue, 10 Sep 2013 21:28:42 +0000 (09:28 +1200)
committerSam Hemelryk <sam@moodle.com>
Tue, 10 Sep 2013 21:28:42 +0000 (09:28 +1200)
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/src/editor/js/editor.js

index 9bd1136..f58ff62 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js differ
index 10ec58e..a0135ca 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js differ
index 9bd1136..f58ff62 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js differ
index 4c75cc7..712262f 100644 (file)
@@ -56,13 +56,21 @@ M.editor_atto = M.editor_atto || {
         var disabled = this.getAttribute('disabled');
         var overlayid = this.getAttribute('data-menu');
         var overlay = M.editor_atto.menus[overlayid];
-
+        var menu = overlay.get('bodyContent');
         if (overlay.get('visible') || disabled) {
             overlay.hide();
+            menu.detach('clickoutside');
         } else {
+            menu.on('clickoutside', function(ev) {
+                if (ev.target.ancestor() !== this) {
+                    if (overlay.get('visible')) {
+                        menu.detach('clickoutside');
+                        overlay.hide();
+                    }
+                }
+            }, this);
             overlay.show();
         }
-
     },
 
     /**
@@ -161,7 +169,6 @@ M.editor_atto = M.editor_atto || {
 
         var menu = Y.Node.create('<div class="atto_' + plugin + '_menu' +
                                  ' atto_menu" data-editor="' + Y.Escape.html(elementid) + '"></div>');
-
         var i = 0, entry = {};
 
         for (i = 0; i < entries.length; i++) {