简体   繁体   中英

Sortable working with 1.7.2 but not with 1.11.2

I use sortable function to be able to sort some textareas (I want to be able to sort textarea and to color text inside those textarea.)

It is working fine when using 1.7.2 version of jQuery, but it is not working anymore when using jQuery 1.11.2

here my code in js.do (the code is with 1.7.2, but if you change 7 for 11 the sortable functionality wont be working anymore)

Here line 29,30,31 of my code

    //LINES_ISSUE_START
    $('.sortable').sortable({
        cancel: '.textarea,.block_bouton_color'
    });   
    //LINES_ISSUE_END

Any idea about how to fix it?

You have to change this

cancel: '.textarea,.block_bouton_color,',

to this

 cancel: '.textarea,.block_bouton_color'

and include the jQuery migrate plugin.

OK now it is working

here the changement I made

1/ I use jquery_1.11.2 as I wanted (standard to user bootstrap)
2/ I switch for jquery_UI_1.11.4 (last version at the time I am writing) 3/ As recommanded by meskobalazs I modify the line cancel as follow without ","

cancel: '.textarea,.block_bouton_color'

4/ Finally I had to add

$(".sortable").sortable();

HERE THE CODE (BEFORE ANY MODIFICATION)

$(".sortable").delegate(".bouton_ordre_drag_and_drop","mouseover",function(){
    $(".sortable").sortable("enable");   
    $(".sortable").sortable({   
        cancel: '.textarea,.block_bouton_color,',
    });   
});

HERE THE CODE (AFTER MODIFICATION)

$(".sortable").sortable();
$(".sortable").delegate(".bouton_ordre_drag_and_drop","mouseover",function(){
    $(".sortable").sortable("enable");   
    $(".sortable").sortable({   
        cancel: '.textarea,.block_bouton_color'
    });   
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM