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
This commit is contained in:
Toshi MARUYAMA 2012-02-16 01:35:52 +00:00
parent fc7b71b334
commit a8f98bb749
1 changed files with 20 additions and 20 deletions

View File

@ -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