From 18073c971e69fcfbfcafc8f2ec81768ea18220f8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 29 Oct 2016 14:06:15 +0000 Subject: 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 --- public/javascripts/context_menu.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'public/javascripts') 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); }); -- cgit v1.2.3