Like the title mentions I’m trying to create the sortable list from this recipe in Meteor 1.3. How do I use $.sortable()
with the new NPM package manager? I have tried
import { sortable } from 'html5sortable'; // is this right?
// from recipe
var initSortable = function( sortableClass ){
let sortableList = $( sortableClass );
sortableList.sortable( 'destroy' ); // crashes here
sortableList.sortable();
sortableList.sortable().off( 'sortupdate' );
sortableList.sortable().on( 'sortupdate', () => {
updateIndexes( '.sortable' );
});
};
with no success.
Exception from Tracker afterFlush function:
meteor.js?hash=ec96c6f…:913 TypeError: sortableList.sortable is not a function
at initSortable (gallery.js:5)
at .<anonymous> (gallery.js:29)
at blaze.js?hash=38069f4…:3331
at Function.Template._withTemplateInstanceFunc (blaze.js?hash=38069f4…:3677)
at fireCallbacks (blaze.js?hash=38069f4…:3327)
at .<anonymous> (blaze.js?hash=38069f4…:3420)
at blaze.js?hash=38069f4…:1773
at Object.Blaze._withCurrentView (blaze.js?hash=38069f4…:2204)
at blaze.js?hash=38069f4…:1772
at Object.Tracker._runFlush (tracker.js?hash=b267c37…:515)
EDIT
continuing on this,
import Sortable from 'html5sortable';
console.log(Sortable);
show that Sortable is function(selector, options){...
however calling this function with the selector as an argument produced no observable results.
Does anyone have insight?