From 46bb48e4706709d5e77590eb1f038c66f60e5edc Mon Sep 17 00:00:00 2001 From: lavrton Date: Tue, 20 Jan 2015 17:06:21 +0700 Subject: [PATCH] fix docs --- CHANGELOG.md | 44 +++++++++++++++++++++++------------------- Gruntfile.js | 3 ++- src/Node.js | 54 ++++++++++++++++++++++------------------------------ src/Shape.js | 3 +++ 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b45efac3..af4ef8d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,25 +2,29 @@ * Bug Fixes * working "this-example" as name for nodes + * Kinetic.Text() with no config throws exception +* Enhancements + * `black` is default fill for shapes ## 5.1.9 2014-01-09 - * Bug Fixes - * Correct stage resizing with `FastLayer` - * `batchDraw` method for `FastLayer` - * Correct mouseover/mouseout/mouseenter/mouseleave events for groups - * cache node before adding to layer - * `intersects` function now works for shapes with shadow - * Enhancements - * npm package. See https://github.com/ericdrowell/KineticJS#installation - * much better dragging performance - * `browserify` support - * applying opacity to cached node - * remove all events with `node.off()` - * mouse dragging only with left button - * opacity now affect cached shapes - * Label corner radius - * smart changing `width`, `height`, `radius` attrs for circle, start, ellipse, ring. - * `mousewheel` support. Thanks [@vmichnowicz](https://github.com/vmichnowicz) - * new Arrow plugin - * multiple names: `node.name('foo bar'); container.find('.foo');` (thanks [@mattslocum](https://github.com/mattslocum)) - * `Container.findOne()` method. (thanks [@pronebird](https://github.com/pronebird)) \ No newline at end of file + +* Bug Fixes + * Correct stage resizing with `FastLayer` + * `batchDraw` method for `FastLayer` + * Correct mouseover/mouseout/mouseenter/mouseleave events for groups + * cache node before adding to layer + * `intersects` function now works for shapes with shadow +* Enhancements + * npm package. See https://github.com/ericdrowell/KineticJS#installation + * much better dragging performance + * `browserify` support + * applying opacity to cached node + * remove all events with `node.off()` + * mouse dragging only with left button + * opacity now affect cached shapes + * Label corner radius + * smart changing `width`, `height`, `radius` attrs for circle, start, ellipse, ring. + * `mousewheel` support. Thanks [@vmichnowicz](https://github.com/vmichnowicz) + * new Arrow plugin + * multiple names: `node.name('foo bar'); container.find('.foo');` (thanks [@mattslocum](https://github.com/mattslocum)) + * `Container.findOne()` method. (thanks [@pronebird](https://github.com/pronebird)) \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 2abba737..a4ef942a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -223,7 +223,7 @@ module.exports = function(grunt) { }, jsdoc : { dist : { - src: ['README.md', './src/**/*.js'], + src: ['README.md', './dist/kinetic-v<%= pkg.version %>.js'], options: { destination: 'api', template : './node_modules/grunt-jsdoc/node_modules/ink-docstrap/template', @@ -266,6 +266,7 @@ module.exports = function(grunt) { ]); grunt.registerTask('api', 'Generate docs for homepage', [ + 'full', 'jsdoc' ]); diff --git a/src/Node.js b/src/Node.js index 984f6ae1..ef645ba9 100644 --- a/src/Node.js +++ b/src/Node.js @@ -348,17 +348,6 @@ name: name, handler: handler }); - - // NOTE: this flag is set to true when any event handler is added, even non - // mouse or touch gesture events. This improves performance for most - // cases where users aren't using events, but is still very light weight. - // To ensure perfect accuracy, devs can explicitly set listening to false. - /* - if (name !== KINETIC) { - this._listeningEnabled = true; - this._clearSelfAndAncestorCache(LISTENING_ENABLED); - } - */ } return this; @@ -1845,6 +1834,7 @@ /** * get/set offset x * @name offsetX + * @method * @memberof Kinetic.Node.prototype * @param {Number} x * @returns {Number} @@ -1858,26 +1848,6 @@ Kinetic.Factory.addGetterSetter(Kinetic.Node, 'offsetY', 0); - /** - * get/set drag distance - * @name dragDistance - * @memberof Kinetic.Node.prototype - * @param {Number} distance - * @returns {Number} - * @example - * // get drag distance - * var dragDistance = node.dragDistance(); - * - * // set distance - * // node starts dragging only if pointer moved more then 3 pixels - * node.dragDistance(3); - * // or set globally - * Kinetic.dragDistance = 3; - */ - - Kinetic.Factory.addSetter(Kinetic.Node, 'dragDistance'); - Kinetic.Factory.addOverloadedGetterSetter(Kinetic.Node, 'dragDistance'); - /** * get/set offset y * @name offsetY @@ -1893,6 +1863,28 @@ * node.offsetY(3); */ + Kinetic.Factory.addSetter(Kinetic.Node, 'dragDistance'); + Kinetic.Factory.addOverloadedGetterSetter(Kinetic.Node, 'dragDistance'); + + /** + * get/set drag distance + * @name dragDistance + * @method + * @memberof Kinetic.Node.prototype + * @param {Number} distance + * @returns {Number} + * @example + * // get drag distance + * var dragDistance = node.dragDistance(); + * + * // set distance + * // node starts dragging only if pointer moved more then 3 pixels + * node.dragDistance(3); + * // or set globally + * Kinetic.dragDistance = 3; + */ + + Kinetic.Factory.addSetter(Kinetic.Node, 'width', 0); Kinetic.Factory.addOverloadedGetterSetter(Kinetic.Node, 'width'); /** diff --git a/src/Shape.js b/src/Shape.js index 1c8ae6c5..c9801acf 100644 --- a/src/Shape.js +++ b/src/Shape.js @@ -730,6 +730,9 @@ * * // set fill color with rgba and make it 50% opaque * shape.fill('rgba(0,255,0,0.5'); + * + * // shape without fill + * shape.fill(null); */ Kinetic.Factory.addGetterSetter(Kinetic.Shape, 'fillRed', 0, Kinetic.Validators.RGBComponent);