2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
8 YUI.add('event-resize', function (Y, NAME) {
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
19 * Old firefox fires the window resize event once when the resize action
20 * finishes, other browsers fire the event periodically during the
21 * resize. This code uses timeout logic to simulate the Firefox
22 * behavior in other browsers.
26 Y.Event.define('windowresize', {
28 on: (Y.UA.gecko && Y.UA.gecko < 1.91) ?
29 function (node, sub, notifier) {
30 sub._handle = Y.Event.attach('resize', function (e) {
34 function (node, sub, notifier) {
35 // interval bumped from 40 to 100ms as of 3.4.1
36 var delay = Y.config.windowResizeDelay || 100;
38 sub._handle = Y.Event.attach('resize', function (e) {
43 sub._timer = Y.later(delay, Y, function () {
49 detach: function (node, sub) {
55 // delegate methods not defined because this only works for window
56 // subscriptions, so...yeah.
60 }, '3.13.0', {"requires": ["node-base", "event-synthetic"]});