mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +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) {
|
function contextMenuRightClick(event) {
|
||||||
var target = $(event.target);
|
var target = $(event.target);
|
||||||
if (target.is('a')) {return;}
|
if (target.is('a')) {return;}
|
||||||
var tr = target.parents('tr').first();
|
var tr = target.closest('.hascontextmenu').first();
|
||||||
if (!tr.hasClass('hascontextmenu')) {return;}
|
if (tr.length < 1) {return;}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!contextMenuIsSelected(tr)) {
|
if (!contextMenuIsSelected(tr)) {
|
||||||
contextMenuUnselectAll();
|
contextMenuUnselectAll();
|
||||||
@ -28,8 +28,8 @@ function contextMenuClick(event) {
|
|||||||
contextMenuHide();
|
contextMenuHide();
|
||||||
if (target.is('a') || target.is('img')) { return; }
|
if (target.is('a') || target.is('img')) { return; }
|
||||||
if (event.which == 1 || (navigator.appVersion.match(/\bMSIE\b/))) {
|
if (event.which == 1 || (navigator.appVersion.match(/\bMSIE\b/))) {
|
||||||
var tr = target.parents('tr').first();
|
var tr = target.closest('.hascontextmenu').first();
|
||||||
if (tr.length && tr.hasClass('hascontextmenu')) {
|
if (tr.length > 0) {
|
||||||
// a row was clicked, check if the click was on checkbox
|
// a row was clicked, check if the click was on checkbox
|
||||||
if (target.is('input')) {
|
if (target.is('input')) {
|
||||||
// a checkbox may be clicked
|
// a checkbox may be clicked
|
||||||
@ -104,6 +104,7 @@ function contextMenuShow(event) {
|
|||||||
$('#context-menu').html('');
|
$('#context-menu').html('');
|
||||||
|
|
||||||
url = $(event.target).parents('form').first().data('cm-url');
|
url = $(event.target).parents('form').first().data('cm-url');
|
||||||
|
if (url == null) {alert('no url'); return;}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
@ -224,7 +225,7 @@ function contextMenuInit() {
|
|||||||
function toggleIssuesSelection(el) {
|
function toggleIssuesSelection(el) {
|
||||||
var checked = $(this).prop('checked');
|
var checked = $(this).prop('checked');
|
||||||
var boxes = $(this).parents('table').find('input[name=ids\\[\\]]');
|
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() {
|
function window_size() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user