javascript - JQuery UI Sorting Breaks A Element Href Links -
example
https://jsfiddle.net/e80tl2kl/
- to start can click text in bars , open google in new tab.
- proceed click edit button , able drag tabs around not able click text open google.
- click edit again , should disable movement , enable links again.
- however clicking text of bar has been moved not open link on first click clicking second time will.
for example i'm using
$('a').attr('onclick', 'return true;');
to re-enable links.
however have tried using:
$('a').attr('onclick', '');
$('a').attr('onclick', null);
$('a').attr('onclick', '').unbind('click');
$('a').prop('onclick',null).off('click');
all of have same result.
why "first click doesn't work after moving" happen , how can fix it?
probably bug jquery-ui
, can fix easily. there's bind
doesn't unbind
on disable
. can unbind
manually this:
} else if (edit == true) { edit = false; $("#sortable").sortable('disable'); $("#sortable").unbind('click.sortable'); $('a').attr('onclick', 'return true'); }
Comments
Post a Comment