diff --git a/Ractive-decorators-sortable.js b/Ractive-decorators-sortable.js index bfd8ad6..beb0e87 100644 --- a/Ractive-decorators-sortable.js +++ b/Ractive-decorators-sortable.js @@ -64,12 +64,12 @@ // Common JS (i.e. browserify) environment if ( typeof module !== 'undefined' && module.exports && typeof require === 'function' ) { - factory( require( 'Ractive' ) ); + factory( require( 'ractive' ) ); } // AMD? else if ( typeof define === 'function' && define.amd ) { - define([ 'Ractive' ], factory ); + define([ 'ractive' ], factory ); } // browser global @@ -199,4 +199,4 @@ Ractive.decorators.sortable = sortable; -})); \ No newline at end of file +})); diff --git a/Ractive-decorators-sortable.min.js b/Ractive-decorators-sortable.min.js index 90fa355..529f1ad 100644 --- a/Ractive-decorators-sortable.min.js +++ b/Ractive-decorators-sortable.min.js @@ -1 +1 @@ -!function(a,b){"use strict";if("undefined"!=typeof module&&module.exports&&"function"==typeof require)b(require("Ractive"));else if("function"==typeof define&&define.amd)define(["Ractive"],b);else{if(!a.Ractive)throw new Error("Could not find Ractive! It must be loaded before the Ractive-decorators-sortable plugin");b(a.Ractive)}}("undefined"!=typeof window?window:this,function(a){"use strict";var b,c,d,e,f,g,h,i,j,k;b=function(a){return a.draggable=!0,a.addEventListener("dragstart",g,!1),a.addEventListener("dragenter",h,!1),a.addEventListener("dragleave",i,!1),a.addEventListener("drop",i,!1),a.addEventListener("dragover",j,!1),{teardown:function(){a.removeEventListener("dragstart",g,!1),a.removeEventListener("dragenter",h,!1),a.removeEventListener("dragleave",i,!1),a.removeEventListener("drop",i,!1),a.removeEventListener("dragover",j,!1)}}},b.targetClass="droptarget",k="The sortable decorator only works with elements that correspond to array members",g=function(a){var b,g=this._ractive;if(d=g.keypath,b=d.lastIndexOf("."),-1===b)throw new Error(k);if(e=d.substr(0,b),f=+d.substring(b+1),isNaN(f))throw new Error(k);a.dataTransfer.setData("foo",!0),c=g.root},h=function(){var a,d,g,h,i,j;if(this._ractive.root===c){if(a=this._ractive.keypath,d=a.lastIndexOf("."),-1===d)throw new Error(k);if(g=a.substr(0,d),h=+a.substring(d+1),g===e){if(h===f)return this.classList.add(b.targetClass),void 0;i=c.get(e),j=i.splice(f,1)[0],f=h,i.splice(f,0,j)}}},i=function(){this.classList.remove(b.targetClass)},j=function(a){a.preventDefault()},a.decorators.sortable=b}); \ No newline at end of file +!function(a,b){"use strict";if("undefined"!=typeof module&&module.exports&&"function"==typeof require)b(require("ractive"));else if("function"==typeof define&&define.amd)define(["ractive"],b);else{if(!a.Ractive)throw new Error("Could not find Ractive! It must be loaded before the Ractive-decorators-sortable plugin");b(a.Ractive)}}("undefined"!=typeof window?window:this,function(a){"use strict";var b,c,d,e,f,g,h,i,j,k;b=function(a){return a.draggable=!0,a.addEventListener("dragstart",g,!1),a.addEventListener("dragenter",h,!1),a.addEventListener("dragleave",i,!1),a.addEventListener("drop",i,!1),a.addEventListener("dragover",j,!1),{teardown:function(){a.removeEventListener("dragstart",g,!1),a.removeEventListener("dragenter",h,!1),a.removeEventListener("dragleave",i,!1),a.removeEventListener("drop",i,!1),a.removeEventListener("dragover",j,!1)}}},b.targetClass="droptarget",k="The sortable decorator only works with elements that correspond to array members",g=function(a){var b,g=this._ractive;if(d=g.keypath,b=d.lastIndexOf("."),-1===b)throw new Error(k);if(e=d.substr(0,b),f=+d.substring(b+1),isNaN(f))throw new Error(k);a.dataTransfer.setData("foo",!0),c=g.root},h=function(){var a,d,g,h,i,j;if(this._ractive.root===c){if(a=this._ractive.keypath,d=a.lastIndexOf("."),-1===d)throw new Error(k);if(g=a.substr(0,d),h=+a.substring(d+1),g===e){if(h===f)return this.classList.add(b.targetClass),void 0;i=c.get(e),j=i.splice(f,1)[0],f=h,i.splice(f,0,j)}}},i=function(){this.classList.remove(b.targetClass)},j=function(a){a.preventDefault()},a.decorators.sortable=b}); diff --git a/src/Ractive-decorators-sortable.js b/src/Ractive-decorators-sortable.js index d0e54c4..2137285 100644 --- a/src/Ractive-decorators-sortable.js +++ b/src/Ractive-decorators-sortable.js @@ -64,12 +64,12 @@ // Common JS (i.e. browserify) environment if ( typeof module !== 'undefined' && module.exports && typeof require === 'function' ) { - factory( require( 'Ractive' ) ); + factory( require( 'ractive' ) ); } // AMD? else if ( typeof define === 'function' && define.amd ) { - define([ 'Ractive' ], factory ); + define([ 'ractive' ], factory ); } // browser global @@ -199,4 +199,4 @@ Ractive.decorators.sortable = sortable; -})); \ No newline at end of file +}));