mirror of
https://github.com/meineerde/redmine.git
synced 2025-10-17 17:01:01 +00:00
Let the context menu work on elements that are not tr.
git-svn-id: http://svn.redmine.org/redmine/trunk@16508 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2dfec42484
commit
8ea86a8249
@ -6,8 +6,8 @@ var contextMenuObserving;
|
||||
function contextMenuRightClick(event) {
|
||||
var target = $(event.target);
|
||||
if (target.is('a')) {return;}
|
||||
var tr = target.parents('tr').first();
|
||||
if (!tr.hasClass('hascontextmenu')) {return;}
|
||||
var tr = target.closest('.hascontextmenu').first();
|
||||
if (tr.length < 1) {return;}
|
||||
event.preventDefault();
|
||||
if (!contextMenuIsSelected(tr)) {
|
||||
contextMenuUnselectAll();
|
||||
@ -28,8 +28,8 @@ function contextMenuClick(event) {
|
||||
contextMenuHide();
|
||||
if (target.is('a') || target.is('img')) { return; }
|
||||
if (event.which == 1 || (navigator.appVersion.match(/\bMSIE\b/))) {
|
||||
var tr = target.parents('tr').first();
|
||||
if (tr.length && tr.hasClass('hascontextmenu')) {
|
||||
var tr = target.closest('.hascontextmenu').first();
|
||||
if (tr.length > 0) {
|
||||
// a row was clicked, check if the click was on checkbox
|
||||
if (target.is('input')) {
|
||||
// a checkbox may be clicked
|
||||
@ -104,6 +104,7 @@ function contextMenuShow(event) {
|
||||
$('#context-menu').html('');
|
||||
|
||||
url = $(event.target).parents('form').first().data('cm-url');
|
||||
if (url == null) {alert('no url'); return;}
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
@ -224,7 +225,7 @@ function contextMenuInit() {
|
||||
function toggleIssuesSelection(el) {
|
||||
var checked = $(this).prop('checked');
|
||||
var boxes = $(this).parents('table').find('input[name=ids\\[\\]]');
|
||||
boxes.prop('checked', checked).parents('tr').toggleClass('context-menu-selection', checked);
|
||||
boxes.prop('checked', checked).parents('.hascontextmenu').toggleClass('context-menu-selection', checked);
|
||||
}
|
||||
|
||||
function window_size() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user