diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-10-29 14:06:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-10-29 14:06:15 +0000 |
commit | 18073c971e69fcfbfcafc8f2ec81768ea18220f8 (patch) | |
tree | 84b3ae221e6cbaae1d3253d397490f41a8b1a840 /public/javascripts | |
parent | 7cce582c14a0022032cb33c60ad46715ec83af81 (diff) | |
download | redmine-18073c971e69fcfbfcafc8f2ec81768ea18220f8.tar.gz redmine-18073c971e69fcfbfcafc8f2ec81768ea18220f8.zip |
Don't use a global variable for storing context menu URL.
git-svn-id: http://svn.redmine.org/redmine/trunk@15936 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/javascripts')
-rw-r--r-- | public/javascripts/context_menu.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js index ca2a9bec9..6fd509ea6 100644 --- a/public/javascripts/context_menu.js +++ b/public/javascripts/context_menu.js @@ -2,7 +2,6 @@ Copyright (C) 2006-2016 Jean-Philippe Lang */ var contextMenuObserving; -var contextMenuUrl; function contextMenuRightClick(event) { var target = $(event.target); @@ -98,13 +97,16 @@ function contextMenuShow(event) { var window_height; var max_width; var max_height; + var url; $('#context-menu').css('left', (render_x + 'px')); $('#context-menu').css('top', (render_y + 'px')); $('#context-menu').html(''); + url = $(event.target).parents('form').first().data('cm-url'); + $.ajax({ - url: contextMenuUrl, + url: url, data: $(event.target).parents('form').first().serialize(), success: function(data, textStatus, jqXHR) { $('#context-menu').html(data); @@ -208,8 +210,7 @@ function contextMenuClearDocumentSelection() { } } -function contextMenuInit(url) { - contextMenuUrl = url; +function contextMenuInit() { contextMenuCreate(); contextMenuUnselectAll(); @@ -243,5 +244,6 @@ function window_size() { } $(document).ready(function(){ + contextMenuInit(); $('input[type=checkbox].toggle-selection').on('change', toggleIssuesSelection); }); |