maddisondesigns / customizer-custom-controls

WordPress Customizer Custom Controls
403 stars 120 forks source link

Error Uncaught TypeError: $(...).sortable is not a function #22

Closed ASL07 closed 4 years ago

ASL07 commented 4 years ago

Hi, Thanks for the repo, looks great. I am testing your controls with my theme based on Sage 9 and I am getting the next error: Uncaught TypeError: $(...).sortable is not a function on customizer.js

$( ".pill_checkbox_control .sortable" ).sortable({
        placeholder: "pill-ui-state-highlight",
        update: function( event, ui ) {
            skyrocketGetAllPillCheckboxes($(this).parent());
        }
    });

Any idea what the problem is? Thanks

maddisondesigns commented 4 years ago

jQuery sortable requires jQuery UI.

It looks like I didn't specify that as a dependency when enqueuing the scripts for that Pill Checkbox Control. I have it set on another couple of controls (Sortable Repeater and Slider controls) which is why I never picked it up. I'm guessing you're not using those other controls though, which is why it didn't get enqueued. I've just fixed this up for you now.

You can just grab a new copy of inc/custom-controls.php and that should fix it for you.

ASL07 commented 4 years ago

Great! Working now Thank you

maddisondesigns commented 4 years ago

No worries. Great to hear! 👍