mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Avoid name clash between View._handlers and Callback._handlers that keeps track of installed handlers.
Closes #109.
This commit is contained in:
parent
46de04d29d
commit
20797b8cc3
1 changed files with 3 additions and 3 deletions
|
@ -92,7 +92,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
||||||
if (this._id == null)
|
if (this._id == null)
|
||||||
element.setAttribute('id', this._id = 'view-' + View._id++);
|
element.setAttribute('id', this._id = 'view-' + View._id++);
|
||||||
// Install event handlers
|
// Install event handlers
|
||||||
DomEvent.add(element, this._handlers);
|
DomEvent.add(element, this._viewHandlers);
|
||||||
// If the element has the resize attribute, resize the it to fill the
|
// If the element has the resize attribute, resize the it to fill the
|
||||||
// window and resize it again whenever the user resizes the window.
|
// window and resize it again whenever the user resizes the window.
|
||||||
if (PaperScript.hasAttribute(element, 'resize')) {
|
if (PaperScript.hasAttribute(element, 'resize')) {
|
||||||
|
@ -172,7 +172,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
||||||
if (this._project.view == this)
|
if (this._project.view == this)
|
||||||
this._project.view = null;
|
this._project.view = null;
|
||||||
// Uninstall event handlers again for this view.
|
// Uninstall event handlers again for this view.
|
||||||
DomEvent.remove(this._element, this._handlers);
|
DomEvent.remove(this._element, this._viewHandlers);
|
||||||
DomEvent.remove(window, this._windowHandlers);
|
DomEvent.remove(window, this._windowHandlers);
|
||||||
this._element = this._project = null;
|
this._element = this._project = null;
|
||||||
// Removing all onFrame handlers makes the _onFrameCallback handler stop
|
// Removing all onFrame handlers makes the _onFrameCallback handler stop
|
||||||
|
@ -594,7 +594,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_handlers: {
|
_viewHandlers: {
|
||||||
mousedown: mousedown,
|
mousedown: mousedown,
|
||||||
touchstart: mousedown,
|
touchstart: mousedown,
|
||||||
selectstart: selectstart
|
selectstart: selectstart
|
||||||
|
|
Loading…
Reference in a new issue