Adds an helper for creating the context menu.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3542 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-03-04 19:02:57 +00:00
parent 12759fd416
commit bd5fe10c13
4 changed files with 24 additions and 12 deletions
+11 -1
View File
@@ -7,7 +7,8 @@ ContextMenu = Class.create();
ContextMenu.prototype = {
initialize: function (url) {
this.url = url;
this.createMenu();
// prevent text selection in the issue list
var tables = $$('table.issues');
for (i=0; i<tables.length; i++) {
@@ -95,6 +96,15 @@ ContextMenu.prototype = {
}
},
createMenu: function() {
if (!$('context-menu')) {
var menu = document.createElement("div");
menu.setAttribute("id", "context-menu");
menu.setAttribute("style", "display:none;");
document.getElementById("content").appendChild(menu);
}
},
showMenu: function(e) {
var mouse_x = Event.pointerX(e);
var mouse_y = Event.pointerY(e);