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');      } 

https://jsfiddle.net/rh27oxph/1/


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -