Skip to content

Commit 1c6f3ca

Browse files
committed
#1 优化右键删除导航图标
1 parent 525eda8 commit 1c6f3ca

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

js/main.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
var storedata = store("maindata");
32

43

@@ -21,24 +20,26 @@ if(storedata&&storedata.length>0){
2120
}
2221

2322
// 屏蔽右键菜单 动画
24-
$('body').on('click',function(){
25-
$('#iconList li a').removeClass('animated shakeSlow');
26-
// $('#iconList li a').addClass('animated flipOutX');
27-
$('#iconList li div.close').css({
28-
"visibility": 'hidden'
29-
});
23+
$('body').on('click',function(evn,e){
24+
var $elm = $(evn.toElement).parent();
25+
if(evn.toElement.tagName === 'DIV'&&evn.toElement.className === 'close'&&$elm.attr('tagName') === 'LI'){
26+
27+
}else{
28+
$('#iconList li a').removeClass('animated shakeSlow');
29+
$('#iconList li div.close').css({
30+
"visibility": 'hidden'
31+
});
32+
}
3033
}).on('contextmenu',function(){
3134
$('#iconList li a').addClass('animated shakeSlow');
3235
$('#iconList li div.close').css({
3336
"visibility": 'inherit'
3437
}).on('click',function(){
35-
3638
var url = $(this).next().attr('href');
3739
if(url){
3840
$(this).parent().remove();
39-
removeItem(url)
41+
removeItem(url);
4042
}
41-
4243
})
4344
return false;
4445
})

0 commit comments

Comments
 (0)