Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions jquery.ba-resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@
var elem = $(this),
data = $.data( this, str_data );

// If called from the polling loop, w and h will be passed in as
// arguments. If called manually, via .trigger( 'resize' ) or .resize(),
// those values will need to be computed.
data.w = w !== undefined ? w : elem.width();
data.h = h !== undefined ? h : elem.height();

old_handler.apply( this, arguments );
if(data){
// If called from the polling loop, w and h will be passed in as
// arguments. If called manually, via .trigger( 'resize' ) or .resize(),
// those values will need to be computed.
data.w = w !== undefined ? w : elem.width();
data.h = h !== undefined ? h : elem.height();

old_handler.apply( this, arguments );
}
};

// This may seem a little complicated, but it normalizes the special event
Expand Down