Here is my code:
doc.on('mousedown', '.qandacontent', function() {
timeout_id = setTimeout(menu_toggle.bind(this), 1000);
}).bind('mouseup mouseleave', function() {
clearTimeout(timeout_id);
});
This will show a pop up if you click on element .qandacontent
and hold it for 1 sec. Now I want to make it working only if no text is selected (marked) while click-holding. Any idea how can I do that?