woocommerce/assets/js/jquery-flot/jquery.flot.resize.min.js

1 line
1.1 KiB
JavaScript

!function(r,i,s){var n,h=r([]),a=r.resize=r.extend(r.resize,{}),u="setTimeout",o="resize",d=o+"-special-event",c="delay",f="throttleWindow";a[c]=250,a[f]=!0,r.event.special[o]={setup:function(){if(!a[f]&&this[u])return!1;var t=r(this);h=h.add(t),r.data(this,d,{w:t.width(),h:t.height()}),1===h.length&&function e(){n=i[u](function(){h.each(function(){var t=r(this),e=t.width(),i=t.height(),n=r.data(this,d);e===n.w&&i===n.h||t.trigger(o,[n.w=e,n.h=i])}),e()},a[c])}()},teardown:function(){if(!a[f]&&this[u])return!1;var t=r(this);h=h.not(t),t.removeData(d),h.length||clearTimeout(n)},add:function(t){return!(!a[f]&&this[u])&&("function"==typeof t?(o=t,e):(o=t.handler,void(t.handler=e)));var o;function e(t,e,i){var n=r(this),h=r.data(this,d);h.w=e!==s?e:n.width(),h.h=i!==s?i:n.height(),o.apply(this,arguments)}}}}(jQuery,this),jQuery.plot.plugins.push({init:function(e){function i(){var t=e.getPlaceholder();0!=t.width()&&0!=t.height()&&(e.resize(),e.setupGrid(),e.draw())}e.hooks.bindEvents.push(function(t,e){t.getPlaceholder().on("resize",i)}),e.hooks.shutdown.push(function(t,e){t.getPlaceholder().off("resize",i)})},options:{},name:"resize",version:"1.0"});