2 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.net/yui/license.txt
8 YUI.add('event-resize', function(Y) {
11 * Adds a window resize event that has its behavior normalized to fire at the
12 * end of the resize rather than constantly during the resize.
14 * @submodule event-resize
22 CE_NAME = 'window:resize',
24 handler = function(e) {
36 timerHandle = Y.later(Y.config.windowResizeDelay || 40, Y, function() {
45 * Firefox fires the window resize event once when the resize action
46 * finishes, other browsers fire the event periodically during the
47 * resize. This code uses timeout logic to simulate the Firefox
48 * behavior in other browsers.
52 Y.Env.evt.plugins.windowresize = {
54 on: function(type, fn) {
56 // check for single window listener and add if needed
58 detachHandle = Y.Event._attach(['resize', handler]);
61 var a = Y.Array(arguments, 0, true);
64 return Y.on.apply(Y, a);
71 }, '3.0.0' ,{requires:['node-base']});