1// Generated by CoffeeScript 1.6.3 2(function($, window, document) { 3 var ResizeEnd, defaults, plugin; 4 plugin = 'resizeEnd'; 5 defaults = { 6 delay: 250 7 }; 8 ResizeEnd = function(element, options, callback) { 9 if (typeof options === 'function') { 10 callback = options; 11 options = {}; 12 } 13 callback = callback || null; 14 this.element = element; 15 this.settings = $.extend({}, defaults, options); 16 this._defaults = defaults; 17 this._name = plugin; 18 this._timeout = false; 19 this._callback = callback; 20 return this.init(); 21 }; 22 ResizeEnd.prototype = { 23 init: function() { 24 var $el, _this; 25 _this = this; 26 $el = $(this.element); 27 return $el.on('resize', function() { 28 return _this.initResize(); 29 }); 30 }, 31 getUTCDate: function(d) { 32 var curdate; 33 d = d || new Date(); 34 curdate = Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()); 35 return curdate; 36 }, 37 initResize: function() { 38 var _this; 39 _this = this; 40 _this.controlTime = _this.getUTCDate(); 41 if (_this._timeout === false) { 42 _this._timeout = true; 43 return setTimeout(function() { 44 return _this.runCallback(_this); 45 }, _this.settings.delay); 46 } 47 }, 48 runCallback: function(_this) { 49 var nowTime; 50 nowTime = _this.getUTCDate(); 51 if (nowTime - _this.controlTime < _this.settings.delay) { 52 return setTimeout(function() { 53 return _this.runCallback(_this); 54 }, _this.settings.delay); 55 } else { 56 _this._timeout = false; 57 return _this._callback(); 58 } 59 } 60 }; 61 return $.fn[plugin] = function(options, callback) { 62 return this.each(function() { 63 if (!$.data(this, 'plugin_' + plugin)) { 64 return $.data(this, 'plugin_' + plugin, new ResizeEnd(this, options, callback)); 65 } 66 }); 67 }; 68})(jQuery, window, document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.