Mercurial > hg > soundsoftware-site
diff public/javascripts/context_menu.js @ 524:1248a47e81b3 feature_36
Merge from branch "luisf"
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Jul 2011 14:39:38 +0100 |
parents | cbce1fd3b1b7 |
children | cbb26bc654de |
line wrap: on
line diff
--- a/public/javascripts/context_menu.js Fri Jul 15 17:21:05 2011 +0100 +++ b/public/javascripts/context_menu.js Mon Jul 25 14:39:38 2011 +0100 @@ -11,7 +11,7 @@ if (!observingContextMenuClick) { Event.observe(document, 'click', this.Click.bindAsEventListener(this)); - Event.observe(document, (window.opera ? 'click' : 'contextmenu'), this.RightClick.bindAsEventListener(this)); + Event.observe(document, 'contextmenu', this.RightClick.bindAsEventListener(this)); observingContextMenuClick = true; } @@ -23,8 +23,6 @@ this.hideMenu(); // do not show the context menu on links 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'); if (tr == document || tr == undefined || !tr.hasClassName('hascontextmenu')) { return; } Event.stop(e); @@ -38,8 +36,7 @@ Click: function(e) { this.hideMenu(); - if (Event.element(e).tagName == 'A') { return; } - if (window.opera && e.altKey) { return; } + if (Event.element(e).tagName == 'A' || Event.element(e).tagName == 'IMG') { return; } if (Event.isLeftClick(e) || (navigator.appVersion.match(/\bMSIE\b/))) { var tr = Event.findElement(e, 'tr'); if (tr!=null && tr!=document && tr.hasClassName('hascontextmenu')) { @@ -53,7 +50,7 @@ tr.removeClassName('context-menu-selection'); } } else { - if (e.ctrlKey) { + if (e.ctrlKey || e.metaKey) { this.toggleSelection(tr); } else if (e.shiftKey) { if (this.lastSelected != null) { @@ -121,6 +118,7 @@ new Ajax.Updater({success:'context-menu'}, this.url, {asynchronous:true, + method: 'get', evalScripts:true, parameters:Form.serialize(Event.findElement(e, 'form')), onComplete:function(request){