-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathractive-decorators-noUiSlider.min.js
1 lines (1 loc) · 1.11 KB
/
ractive-decorators-noUiSlider.min.js
1
!function(a,b){"use strict";if("undefined"!=typeof module&&module.exports&&"function"==typeof require)b(require("ractive"),require("noUiSlider"));else if("function"==typeof define&&define.amd)define(["ractive","noUiSlider"],b);else{if(!a.Ractive||!a.noUiSlider)throw new Error("Could not find Ractive and noUiSlider! They must be loaded before the ractive-decorators-noUiSlider plugin");b(a.Ractive,a.noUiSlider)}}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c;c=function(a,d){var e,f=a._ractive.root,g=!1,h={};if(d){if(!c.type.hasOwnProperty(d))throw new Error('Ractive noUiSlider type "'+d+'" is not defined!');h=c.type[d],"function"==typeof h&&(h=h.call(this,a))}var i=document.createElement("div");return a.parentNode.insertBefore(i,a.nextSibling),b.create(i,h),a._ractive.binding&&(e=f.observe(a._ractive.binding.keypath.str,function(a){g||(g=!0,window.setTimeout(function(){i.noUiSlider.set(a),g=!1},0))})),i.noUiSlider.on("change",function(b){g||(g=!0,f.set(a._ractive.binding.keypath.str,b),g=!1)}),{teardown:function(){a.noUiSlider.destroy(),e&&e.cancel()}}},c.type={},a.decorators.noUiSlider=c});