To letdoSetTag
function take effect, before that and the first clicking(doule click, 2 clicks), some html elements will be highlight displayed, when user click button again(the second double-click, 4 clicks), then doSetTag(tagid);
takes effect. Below colde takes effect at once double-click(2 clicks), so I would like to count the dbclick and let doSetTag(tagId)
works after the second double-click(4 clicks).
$('#tagLabels .minitag-label').attr('title','Double-Click to cancel the tag').unbind().on('dblclick',function(){
var labelid = $(this).data('id');
var labelName = $(this).text();
if (res.has(tagName) == 1){
window.location.hash = "#resTags";
setTimeout(function()
{
$(hash).css('background-color', '#D8CEC9').animate({
backgroundColor: '#00A087'
}, 200);
doSetTag(tagid);
},5000);
}
})
count = 4
execute your function and reset your count to 0 again – Tav