diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-03-04 19:02:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-03-04 19:02:57 +0000 |
commit | bd5fe10c13b0fb15825f767f696e57bb709c1f68 (patch) | |
tree | a31767557f1516f72e849f357710f4fce83d0de4 /public | |
parent | 12759fd416995f51318c3cf3bfa42e5a1471ae3b (diff) | |
download | redmine-bd5fe10c13b0fb15825f767f696e57bb709c1f68.tar.gz redmine-bd5fe10c13b0fb15825f767f696e57bb709c1f68.zip |
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
Diffstat (limited to 'public')
-rw-r--r-- | public/javascripts/context_menu.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js index dac5076e2..bd3b72618 100644 --- a/public/javascripts/context_menu.js +++ b/public/javascripts/context_menu.js @@ -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); |