1
/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
2
YUI.add('event-resize', function (Y, NAME) {
5
* Adds a window resize event that has its behavior normalized to fire at the
6
* end of the resize rather than constantly during the resize.
8
* @submodule event-resize
13
* Old firefox fires the window resize event once when the resize action
14
* finishes, other browsers fire the event periodically during the
15
* resize. This code uses timeout logic to simulate the Firefox
16
* behavior in other browsers.
20
Y.Event.define('windowresize', {
22
on: (Y.UA.gecko && Y.UA.gecko < 1.91) ?
23
function (node, sub, notifier) {
24
sub._handle = Y.Event.attach('resize', function (e) {
28
function (node, sub, notifier) {
29
// interval bumped from 40 to 100ms as of 3.4.1
30
var delay = Y.config.windowResizeDelay || 100;
32
sub._handle = Y.Event.attach('resize', function (e) {
37
sub._timer = Y.later(delay, Y, function () {
43
detach: function (node, sub) {
49
// delegate methods not defined because this only works for window
50
// subscriptions, so...yeah.
54
}, '3.9.1', {"requires": ["node-base", "event-synthetic"]});