summaryrefslogtreecommitdiffstats
path: root/public/javascripts/context_menu.js
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-16 01:35:52 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-16 01:35:52 +0000
commita8f98bb74903954f28c4299f4ea7a7279d9028dd (patch)
treeb23b03a42ffb21f956ab905516e78edb1c900447 /public/javascripts/context_menu.js
parentfc7b71b334a458f3192d3f8a851a49a94f4285b4 (diff)
downloadredmine-a8f98bb74903954f28c4299f4ea7a7279d9028dd.tar.gz
redmine-a8f98bb74903954f28c4299f4ea7a7279d9028dd.zip
remove trailing white-spaces from public/javascripts/context_menu.js
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8890 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/javascripts/context_menu.js')
-rw-r--r--public/javascripts/context_menu.js40
1 files changed, 20 insertions, 20 deletions
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<rows.length; i++) {
this.removeSelection(rows[i]);
}
},
-
+
checkSelectionBox: function(tr, checked) {
var inputs = Element.getElementsBySelector(tr, 'input');
if (inputs.length > 0) { inputs[0].checked = checked; }
},
-
+
isSelected: function(tr) {
return Element.hasClassName(tr, 'context-menu-selection');
},
-
+
clearDocumentSelection: function() {
if (document.selection) {
document.selection.clear(); // IE