]> git.mxchange.org Git - friendica.git/blobdiff - library/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
TinyMCE 3.5.8 update; some fixes
[friendica.git] / library / tinymce / jscripts / tiny_mce / plugins / contextmenu / editor_plugin_src.js
index 004d011d09aa3f0d8a9fd2770fd288dba2d76f3a..48b0fff99f683fa78a6996bc421370726187269a 100644 (file)
@@ -27,7 +27,7 @@
                 * @param {string} url Absolute URL to where the plugin is located.\r
                 */\r
                init : function(ed) {\r
-                       var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey;\r
+                       var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;\r
 \r
                        t.editor = ed;\r
 \r
                         */\r
                        t.onContextMenu = new tinymce.util.Dispatcher(this);\r
 \r
+                       hideMenu = function(e) {\r
+                               hide(ed, e);\r
+                       };\r
+\r
                        showMenu = ed.onContextMenu.add(function(ed, e) {\r
                                // Block TinyMCE menu on ctrlKey and work around Safari issue\r
                                if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)\r
                                        ed.selection.select(e.target);\r
 \r
                                t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);\r
-                               Event.add(ed.getDoc(), 'click', function(e) {\r
-                                       hide(ed, e);\r
-                               });\r
+                               Event.add(ed.getDoc(), 'click', hideMenu);\r
 \r
                                ed.nodeChanged();\r
                        });\r
-\r
+                       \r
                        ed.onRemove.add(function() {\r
                                if (t._menu)\r
                                        t._menu.removeAll();\r
@@ -78,8 +80,8 @@
 \r
                                if (t._menu) {\r
                                        t._menu.removeAll();\r
-                                       t._menu.destroy();\r
-                                       Event.remove(ed.getDoc(), 'click', hide);\r
+                                        t._menu.destroy();\r
+                                       Event.remove(ed.getDoc(), 'click', hideMenu);\r
                                        t._menu = null;\r
                                }\r
                        };\r