mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
destroy window events when calling destroy correctly
This commit is contained in:
parent
8f0eba8ade
commit
afd4003835
@ -425,10 +425,14 @@ define([
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dom.bind(window, 'resize', function() { _this.onResize() });
|
var _resizeHandler = function () {
|
||||||
dom.bind(this.__ul, 'webkitTransitionEnd', function() { _this.onResize(); });
|
_this.onResize();
|
||||||
dom.bind(this.__ul, 'transitionend', function() { _this.onResize() });
|
};
|
||||||
dom.bind(this.__ul, 'oTransitionEnd', function() { _this.onResize() });
|
|
||||||
|
dom.bind(window, 'resize', _resizeHandler);
|
||||||
|
dom.bind(this.__ul, 'webkitTransitionEnd', _resizeHandler);
|
||||||
|
dom.bind(this.__ul, 'transitionend', _resizeHandler);
|
||||||
|
dom.bind(this.__ul, 'oTransitionEnd', _resizeHandler);
|
||||||
this.onResize();
|
this.onResize();
|
||||||
|
|
||||||
|
|
||||||
@ -482,14 +486,14 @@ define([
|
|||||||
GUI.TEXT_CLOSED = 'Close Controls';
|
GUI.TEXT_CLOSED = 'Close Controls';
|
||||||
GUI.TEXT_OPEN = 'Open Controls';
|
GUI.TEXT_OPEN = 'Open Controls';
|
||||||
|
|
||||||
dom.bind(window, 'keydown', function(e) {
|
var _keydownHandler = function(e) {
|
||||||
|
|
||||||
if (document.activeElement.type !== 'text' &&
|
if (document.activeElement.type !== 'text' &&
|
||||||
(e.which === HIDE_KEY_CODE || e.keyCode == HIDE_KEY_CODE)) {
|
(e.which === HIDE_KEY_CODE || e.keyCode == HIDE_KEY_CODE)) {
|
||||||
GUI.toggleHide();
|
GUI.toggleHide();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}, false);
|
dom.bind(window, 'keydown', _keydownHandler, false);
|
||||||
|
|
||||||
common.extend(
|
common.extend(
|
||||||
|
|
||||||
@ -558,6 +562,10 @@ define([
|
|||||||
auto_place_container.removeChild(this.domElement);
|
auto_place_container.removeChild(this.domElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dom.unbind(window, 'keydown', _keydownHandler, false);
|
||||||
|
dom.unbind(window, 'unload', saveToLocalStorage);
|
||||||
|
dom.unbind(window, 'resize', _resizeHandler);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user