ui: fix multiple resize handlers support
This commit is contained in:
parent
c6e41f5ec2
commit
7f8e02810f
1 changed files with 15 additions and 8 deletions
|
|
@ -31,17 +31,24 @@
|
|||
add: function(handleObj) {
|
||||
if (this===window) return false
|
||||
|
||||
// Save a reference to the bound event handler.
|
||||
var old_handler = handleObj.handler
|
||||
if (this.resizeHandler) {
|
||||
|
||||
var handler = this.resizeHandler
|
||||
|
||||
this.resizeHandler = function(){
|
||||
handler(...arguments)
|
||||
handleObj.handler(...arguments)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
this.resizeHandler = function(){
|
||||
handleObj.handler(...arguments)
|
||||
}
|
||||
|
||||
handleObj.handler = function(event,data) {
|
||||
// Call the originally-bound event handler and return its result.
|
||||
return old_handler.apply(this, arguments)
|
||||
}
|
||||
|
||||
this.resizeHandler = handleObj.handler
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function checkResizes(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue