From 3b2a82047ee76c6cc522e0cfeda02579d88b3c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 8 Oct 2014 18:33:17 +0200 Subject: [PATCH] Clean up event related comments, to reflect recent renaming. --- src/core/PaperScript.js | 2 +- src/item/Item.js | 11 ++++------- src/item/Raster.js | 8 ++++---- src/tool/Tool.js | 17 ++++++----------- src/view/View.js | 11 ++++------- 5 files changed, 19 insertions(+), 30 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 5e573431..315b2111 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -408,7 +408,7 @@ Base.exports.PaperScript = (function() { if (view) { if (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. view.emit('resize', { size: view.size, diff --git a/src/item/Item.js b/src/item/Item.js index 6d7e9eea..ce1842d8 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -3524,8 +3524,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ /** * Detach an event handler from the item. * - * @name Item#detach - * @alias Item#off + * @name Item#off * @function * @param {String('mousedown', 'mouseup', 'mousedrag', 'click', * '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. * - * @name Item#detach - * @alias Item#off + * @name Item#off * @function * @param {Object} object an object literal containing one or more of the * 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 - * @alias Item#trigger + * @name Item#emit * @function * @param {String('mousedown', 'mouseup', 'mousedrag', 'click', * 'doubleclick', 'mousemove', 'mouseenter', 'mouseleave')} type the event diff --git a/src/item/Raster.js b/src/item/Raster.js index e5dc4a8b..95a3e7c3 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -324,8 +324,8 @@ var Raster = Item.extend(/** @lends Raster# */{ // IE has naturalWidth / Height defined, but width / height set to 0 // when the image is invisible in the document. if (image.naturalWidth && image.naturalHeight) { - // Fire load event delayed, so behavior is the same as when it's - // actually loaded and we give the code time to install event + // Emit load event with a delay, so behavior is the same as when + // it's actually loaded and we give the code time to install event. setTimeout(loaded, 0); } else { // 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. // TODO: Fix canvas-node instead image.src = this._data = src; - // Fire load event delayed, so behavior is the same as when it's - // actually loaded and we give the code time to install event + // Emit load event with a delay, so behavior is the same as when + // it's actually loaded and we give the code time to install event. setTimeout(loaded, 0); } else if (/^https?:\/\//.test(src)) { // Load it from remote location: diff --git a/src/tool/Tool.js b/src/tool/Tool.js index d113aeb5..78554d3f 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -411,8 +411,7 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ * * Attach an event handler to the tool. * - * @name Tool#attach - * @alias Tool#on + * @name Tool#on * @function * @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove', * '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. * - * @name Tool#attach - * @alias Tool#on + * @name Tool#on * @function * @param {Object} param an object literal containing one or more of the * following properties: {@code mousedown, mouseup, mousedrag, mousemove, @@ -433,8 +431,7 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ /** * Detach an event handler from the tool. * - * @name Tool#detach - * @alias Tool#off + * @name Tool#off * @function * @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove', * '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. * - * @name Tool#detach - * @alias Tool#off + * @name Tool#off * @function * @param {Object} param an object literal containing one or more of the * 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 - * @alias Tool#trigger + * @name Tool#emit * @function * @param {String('mousedown', 'mouseup', 'mousedrag', 'mousemove', * 'keydown', 'keyup')} type the event type diff --git a/src/view/View.js b/src/view/View.js index 5051f1d7..8ae875b8 100644 --- a/src/view/View.js +++ b/src/view/View.js @@ -605,8 +605,7 @@ var View = Base.extend(Emitter, /** @lends View# */{ /** * Detach an event handler from the view. * - * @name View#detach - * @alias View#off + * @name View#off * @function * @param {String('frame', 'resize')} type the event type * @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. * - * @name View#detach - * @alias View#off + * @name View#off * @function * @param {Object} param an object literal containing one or more of the * following properties: {@code frame, resize} */ /** - * Fire an event on the view. + * Emit an event on the view. * - * @name View#fire - * @alias View#trigger + * @name View#emit * @function * @param {String('frame', 'resize')} type the event type * @param {Object} event an object literal containing properties describing