// generated by coffeescript 1.6.3 (function($, window, document) { var resizeend, defaults, plugin; plugin = 'resizeend'; defaults = { delay: 250 }; resizeend = function(element, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } callback = callback || null; this.element = element; this.settings = $.extend({}, defaults, options); this._defaults = defaults; this._name = plugin; this._timeout = false; this._callback = callback; return this.init(); }; resizeend.prototype = { init: function() { var $el, _this; _this = this; $el = $(this.element); return $el.on('resize', function() { return _this.initresize(); }); }, getutcdate: function(d) { var curdate; d = d || new date(); curdate = date.utc(d.getutcfullyear(), d.getutcmonth(), d.getutcdate(), d.getutchours(), d.getutcminutes(), d.getutcseconds(), d.getutcmilliseconds()); return curdate; }, initresize: function() { var _this; _this = this; _this.controltime = _this.getutcdate(); if (_this._timeout === false) { _this._timeout = true; return settimeout(function() { return _this.runcallback(_this); }, _this.settings.delay); } }, runcallback: function(_this) { var nowtime; nowtime = _this.getutcdate(); if (nowtime - _this.controltime < _this.settings.delay) { return settimeout(function() { return _this.runcallback(_this); }, _this.settings.delay); } else { _this._timeout = false; return _this._callback(); } } }; return $.fn[plugin] = function(options, callback) { return this.each(function() { if (!$.data(this, 'plugin_' + plugin)) { return $.data(this, 'plugin_' + plugin, new resizeend(this, options, callback)); } }); }; })(jquery, window, document);