diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js index d6d800a28..96e2e56b2 100644 --- a/public/javascripts/context_menu.js +++ b/public/javascripts/context_menu.js @@ -1,5 +1,5 @@ -/* redMine - project management software - Copyright (C) 2006-2008 Jean-Philippe Lang */ +/* Redmine - project management software + Copyright (C) 2006-2012 Jean-Philippe Lang */ var observingContextMenuClick; @@ -14,11 +14,11 @@ ContextMenu.prototype = { Event.observe(document, 'contextmenu', this.RightClick.bindAsEventListener(this)); observingContextMenuClick = true; } - + this.unselectAll(); this.lastSelected = null; }, - + RightClick: function(e) { this.hideMenu(); // do not show the context menu on links @@ -41,7 +41,7 @@ ContextMenu.prototype = { } this.hideMenu(); if (Event.element(e).tagName == 'A' || Event.element(e).tagName == 'IMG') { return; } - if (Event.isLeftClick(e) || (navigator.appVersion.match(/\bMSIE\b/))) { + if (Event.isLeftClick(e) || (navigator.appVersion.match(/\bMSIE\b/))) { var tr = Event.findElement(e, 'tr'); if (tr!=null && tr!=document && tr.hasClassName('hascontextmenu')) { // a row was clicked, check if the click was on checkbox @@ -90,7 +90,7 @@ ContextMenu.prototype = { } } }, - + createMenu: function() { if (!$('context-menu')) { var menu = document.createElement("div"); @@ -99,7 +99,7 @@ ContextMenu.prototype = { document.getElementById("content").appendChild(menu); } }, - + showMenu: function(e) { var mouse_x = Event.pointerX(e); var mouse_y = Event.pointerY(e); @@ -114,10 +114,10 @@ ContextMenu.prototype = { var max_height; $('context-menu').style['left'] = (render_x + 'px'); - $('context-menu').style['top'] = (render_y + 'px'); + $('context-menu').style['top'] = (render_y + 'px'); Element.update('context-menu', ''); - new Ajax.Updater({success:'context-menu'}, this.url, + new Ajax.Updater({success:'context-menu'}, this.url, {asynchronous:true, method: 'get', evalScripts:true, @@ -128,11 +128,11 @@ ContextMenu.prototype = { menu_height = dims.height; max_width = mouse_x + 2*menu_width; max_height = mouse_y + menu_height; - + var ws = window_size(); window_width = ws.width; window_height = ws.height; - + /* display the menu above and/or to the left of the click if needed */ if (max_width > window_width) { render_x -= menu_width; @@ -150,22 +150,22 @@ ContextMenu.prototype = { if (render_y <= 0) render_y = 1; $('context-menu').style['left'] = (render_x + 'px'); $('context-menu').style['top'] = (render_y + 'px'); - + Effect.Appear('context-menu', {duration: 0.20}); if (window.parseStylesheets) { window.parseStylesheets(); } // IE }}) }, - + hideMenu: function() { Element.hide('context-menu'); }, - + addSelection: function(tr) { tr.addClassName('context-menu-selection'); this.checkSelectionBox(tr, true); this.clearDocumentSelection(); }, - + toggleSelection: function(tr) { if (this.isSelected(tr)) { this.removeSelection(tr); @@ -173,28 +173,28 @@ ContextMenu.prototype = { this.addSelection(tr); } }, - + removeSelection: function(tr) { tr.removeClassName('context-menu-selection'); this.checkSelectionBox(tr, false); }, - + unselectAll: function() { var rows = $$('.hascontextmenu'); for (i=0; i 0) { inputs[0].checked = checked; } }, - + isSelected: function(tr) { return Element.hasClassName(tr, 'context-menu-selection'); }, - + clearDocumentSelection: function() { if (document.selection) { document.selection.clear(); // IE