Jquery ui .sortable() enable-disable -
first of all, let me explain page structure, can idea how working. i've got number of quick-button
blocks. can sorted jquery ui .sortable()
method, after pressing settings
button (which allows quick buttons sortable). later, order of buttons saved or canceled. need through 3 conditions fired click
event. problem is, on first time ok, on second time when i'm trying press button settings
- sortable()
method not working anymore.
you can see js below:
$('#tune-hot-links').click(function () { //click "settings" button $(".sect-hot-links-inner").sortable(); $(".sect-hot-links-inner").disableselection(); }); $('.button-editgroup button.button-save').click(function () { //click "save" button $(".sect-hot-links-inner").sortable('disabled'); $(".sect-hot-links-inner").enableselection(); }); $('.button-editgroup button.button-cancel').click(function () { //click "cancel" button $(".sect-hot-links-inner").sortable('cancel'); $(".sect-hot-links-inner").sortable('disabled'); $(".sect-hot-links-inner").enableselection(); });
i've tried change .sortable()
.sortable('enable')
@ #tune-hot-links
event. , it's not working.
well, have no idea why, seems changing code this:
$('#tune-hot-links').on( "click", function() { $(".sect-hot-links-inner").sortable("enable"); }); $('.button-editgroup button.button-save').on( "click", function() { $(".sect-hot-links-inner").sortable("disable"); }); $('.button-editgroup button.button-cancel').on( "click", function() { $(".sect-hot-links-inner").sortable('cancel'); $(".sect-hot-links-inner").sortable("disable"); $(".sect-hot-links-inner").enableselection(); });
resolved issue.
Comments
Post a Comment