Clean up event related comments, to reflect recent renaming.

This commit is contained in:
Jürg Lehni 2014-10-08 18:33:17 +02:00
parent 68585276a0
commit 3b2a82047e
5 changed files with 19 additions and 30 deletions

View file

@ -408,7 +408,7 @@ Base.exports.PaperScript = (function() {
if (view) { if (view) {
if (res.onResize) if (res.onResize)
view.setOnResize(res.onResize); view.setOnResize(res.onResize);
// Fire resize event directly, so any user // Emit resize event directly, so any user
// defined resize handlers are called. // defined resize handlers are called.
view.emit('resize', { view.emit('resize', {
size: view.size, size: view.size,

View file

@ -3524,8 +3524,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/** /**
* Detach an event handler from the item. * Detach an event handler from the item.
* *
* @name Item#detach * @name Item#off
* @alias Item#off
* @function * @function
* @param {String('mousedown', 'mouseup', 'mousedrag', 'click', * @param {String('mousedown', 'mouseup', 'mousedrag', 'click',
* 'doubleclick', 'mousemove', 'mouseenter', 'mouseleave')} type the event * 'doubleclick', 'mousemove', 'mouseenter', 'mouseleave')} type the event
@ -3535,8 +3534,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/** /**
* Detach one or more event handlers to the item. * Detach one or more event handlers to the item.
* *
* @name Item#detach * @name Item#off
* @alias Item#off
* @function * @function
* @param {Object} object an object literal containing one or more of the * @param {Object} object an object literal containing one or more of the
* following properties: {@code mousedown, mouseup, mousedrag, click, * following properties: {@code mousedown, mouseup, mousedrag, click,
@ -3544,10 +3542,9 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
*/ */
/** /**
* Fire an event on the item. * Emit an event on the item.
* *
* @name Item#fire * @name Item#emit
* @alias Item#trigger
* @function * @function
* @param {String('mousedown', 'mouseup', 'mousedrag', 'click', * @param {String('mousedown', 'mouseup', 'mousedrag', 'click',
* 'doubleclick', 'mousemove', 'mouseenter', 'mouseleave')} type the event * 'doubleclick', 'mousemove', 'mouseenter', 'mouseleave')} type the event

View file

@ -324,8 +324,8 @@ var Raster = Item.extend(/** @lends Raster# */{
// IE has naturalWidth / Height defined, but width / height set to 0 // IE has naturalWidth / Height defined, but width / height set to 0
// when the image is invisible in the document. // when the image is invisible in the document.
if (image.naturalWidth && image.naturalHeight) { if (image.naturalWidth && image.naturalHeight) {
// Fire load event delayed, so behavior is the same as when it's // Emit load event with a delay, so behavior is the same as when
// actually loaded and we give the code time to install event // it's actually loaded and we give the code time to install event.
setTimeout(loaded, 0); setTimeout(loaded, 0);
} else { } else {
// Trigger the onLoad event on the image once it's loaded // Trigger the onLoad event on the image once it's loaded
@ -345,8 +345,8 @@ var Raster = Item.extend(/** @lends Raster# */{
// Preserve the data in this._data since canvas-node eats it. // Preserve the data in this._data since canvas-node eats it.
// TODO: Fix canvas-node instead // TODO: Fix canvas-node instead
image.src = this._data = src; image.src = this._data = src;
// Fire load event delayed, so behavior is the same as when it's // Emit load event with a delay, so behavior is the same as when
// actually loaded and we give the code time to install event // it's actually loaded and we give the code time to install event.
setTimeout(loaded, 0); setTimeout(loaded, 0);
} else if (/^https?:\/\//.test(src)) { } else if (/^https?:\/\//.test(src)) {
// Load it from remote location: // Load it from remote location:

View file

@ -411,8 +411,7 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
* *
* Attach an event handler to the tool. * Attach an event handler to the tool.
* *
* @name Tool#attach * @name Tool#on
* @alias Tool#on
* @function * @function
* @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove', * @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove',
* 'keydown', 'keyup')} type the event type * 'keydown', 'keyup')} type the event type
@ -422,8 +421,7 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
/** /**
* Attach one or more event handlers to the tool. * Attach one or more event handlers to the tool.
* *
* @name Tool#attach * @name Tool#on
* @alias Tool#on
* @function * @function
* @param {Object} param an object literal containing one or more of the * @param {Object} param an object literal containing one or more of the
* following properties: {@code mousedown, mouseup, mousedrag, mousemove, * following properties: {@code mousedown, mouseup, mousedrag, mousemove,
@ -433,8 +431,7 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
/** /**
* Detach an event handler from the tool. * Detach an event handler from the tool.
* *
* @name Tool#detach * @name Tool#off
* @alias Tool#off
* @function * @function
* @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove', * @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove',
* 'keydown', 'keyup')} type the event type * 'keydown', 'keyup')} type the event type
@ -443,8 +440,7 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
/** /**
* Detach one or more event handlers from the tool. * Detach one or more event handlers from the tool.
* *
* @name Tool#detach * @name Tool#off
* @alias Tool#off
* @function * @function
* @param {Object} param an object literal containing one or more of the * @param {Object} param an object literal containing one or more of the
* following properties: {@code mousedown, mouseup, mousedrag, mousemove, * following properties: {@code mousedown, mouseup, mousedrag, mousemove,
@ -452,10 +448,9 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
*/ */
/** /**
* Fire an event on the tool. * Emit an event on the tool.
* *
* @name Tool#fire * @name Tool#emit
* @alias Tool#trigger
* @function * @function
* @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove', * @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove',
* 'keydown', 'keyup')} type the event type * 'keydown', 'keyup')} type the event type

View file

@ -605,8 +605,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
/** /**
* Detach an event handler from the view. * Detach an event handler from the view.
* *
* @name View#detach * @name View#off
* @alias View#off
* @function * @function
* @param {String('frame', 'resize')} type the event type * @param {String('frame', 'resize')} type the event type
* @param {Function} function The function to be detached * @param {Function} function The function to be detached
@ -635,18 +634,16 @@ var View = Base.extend(Emitter, /** @lends View# */{
/** /**
* Detach one or more event handlers from the view. * Detach one or more event handlers from the view.
* *
* @name View#detach * @name View#off
* @alias View#off
* @function * @function
* @param {Object} param an object literal containing one or more of the * @param {Object} param an object literal containing one or more of the
* following properties: {@code frame, resize} * following properties: {@code frame, resize}
*/ */
/** /**
* Fire an event on the view. * Emit an event on the view.
* *
* @name View#fire * @name View#emit
* @alias View#trigger
* @function * @function
* @param {String('frame', 'resize')} type the event type * @param {String('frame', 'resize')} type the event type
* @param {Object} event an object literal containing properties describing * @param {Object} event an object literal containing properties describing