$j.fn.extend({
"rightclick" : function(fn) {
$j(this).live(
'mousedown',
function(e, a) {
if (e.which == 3 || a == 'right') {
var obj = $j(this);
// console.log('length--------' +
// $j(this).parents('.tmp-length')
// .nextAll('.sandbox').length);
if ($j(this).parents('.tmp-length').nextAll('.sandbox').length == 0) {
var url = "Last.action";
var params = {
projectId : $j('#projectId').val(),
sprintId : $j(this).attr('sprintid')
};
$j.ajax({
type : "GET",
url : url,
data : params,
dataType : "json",
async : false,
cache : false,
success : function(data) {
// console.log(data);
if (data.isLast) {
$j('body').append(
'<div style="position:absolute;height:20px;width:50px;background:#d5dfec; font-size:12px; text-align:center;" id="sprintContextmenu" sprintid="' + $j(obj).attr('sprintid') + '" sprintindex="'
+ $j(obj).attr('sprintindex') + '">Delete</div>');
$j("#sprintContextmenu").css({
"left" : $j(obj).offset().left,
"top" : $j(obj).offset().top + 14
});
}
}
});
}
return false;
}
});
}
});
rightclick
最新推荐文章于 2021-08-30 09:54:23 发布