]> source.dussan.org Git - redmine.git/commitdiff
Fixes context menu with Opera (#1655).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 25 Aug 2008 15:24:23 +0000 (15:24 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 25 Aug 2008 15:24:23 +0000 (15:24 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1762 e93f8b46-1217-0410-a6f0-8f06a7374b81

public/javascripts/context_menu.js

index 198c34d9ae7aa6fcb4ba6554e1e9ebac32fc90ec..20f0fc5a7c171235db3c88d1f9209b8b7b7c17de 100644 (file)
@@ -28,7 +28,7 @@ ContextMenu.prototype = {
        RightClick: function(e) {
                this.hideMenu();
                // do not show the context menu on links
-               if (Event.findElement(e, 'a') != document && Event.findElement(e, 'a') != undefined) { return; }
+               if (Event.element(e).tagName == 'A') { return; }
                // right-click simulated by Alt+Click with Opera
                if (window.opera && !e.altKey) { return; }
                var tr = Event.findElement(e, 'tr');
@@ -44,7 +44,7 @@ ContextMenu.prototype = {
 
   Click: function(e) {
        this.hideMenu();
-       if (Event.findElement(e, 'a') != document && Event.findElement(e, 'a') != undefined ) { return; }
+       if (Event.element(e).tagName == 'A') { return; }
     if (window.opera && e.altKey) {    return; }
     if (Event.isLeftClick(e) || (navigator.appVersion.match(/\bMSIE\b/))) {      
       var tr = Event.findElement(e, 'tr');