diff --git a/build.js b/build.js index ff20584c..f6f39ac8 100644 --- a/build.js +++ b/build.js @@ -53,7 +53,7 @@ else if (minifier === 'closure') { mininfierCmd = 'java -jar ' + rootPath + '/lib/google_closure_compiler.jar --js fabric.js --js_output_file fabric.min.js' + sourceMapFlags; } else if (minifier === 'uglifyjs') { - mininfierCmd = 'uglifyjs ' + amdUglifyFlags + ' --output fabric.min.js fabric.js' + sourceMapFlags; + mininfierCmd = 'uglifyjs ' + amdUglifyFlags + ' --output fabric.min.js fabric.js' + sourceMapFlags; } var buildSh = 'build-sh' in buildArgsAsObject; diff --git a/src/brushes/base_brush.class.js b/src/brushes/base_brush.class.js index 1f35f7cd..87b42db9 100644 --- a/src/brushes/base_brush.class.js +++ b/src/brushes/base_brush.class.js @@ -26,7 +26,7 @@ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype * @type fabric.Shadow * @default */ - shadow: null, + shadow: null, /** * Line endings style of a brush (one of "butt", "round", "square") @@ -47,7 +47,7 @@ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype * @type Array * @default */ - strokeDashArray: null, + strokeDashArray: null, /** * Sets shadow of an object diff --git a/src/brushes/circle_brush.class.js b/src/brushes/circle_brush.class.js index 16f19f82..356440ab 100644 --- a/src/brushes/circle_brush.class.js +++ b/src/brushes/circle_brush.class.js @@ -20,10 +20,11 @@ fabric.CircleBrush = fabric.util.createClass(fabric.BaseBrush, /** @lends fabric this.canvas = canvas; this.points = [ ]; }, + /** - * Invoked inside on mouse down and mouse move - * @param {Object} pointer - */ + * Invoked inside on mouse down and mouse move + * @param {Object} pointer + */ drawDot: function(pointer) { var point = this.addPoint(pointer), ctx = this.canvas.contextTop, diff --git a/src/canvas.class.js b/src/canvas.class.js index 7192ca14..1a5c44d7 100644 --- a/src/canvas.class.js +++ b/src/canvas.class.js @@ -780,8 +780,8 @@ }, /** - * @private - */ + * @private + */ _checkTarget: function(e, obj, pointer) { if (obj && obj.visible && diff --git a/src/mixins/canvas_events.mixin.js b/src/mixins/canvas_events.mixin.js index 30499f60..dba10979 100644 --- a/src/mixins/canvas_events.mixin.js +++ b/src/mixins/canvas_events.mixin.js @@ -140,6 +140,7 @@ _onShake: function(e, self) { this.__onShake && this.__onShake(e, self); }, + /** * @private * @param {Event} [e] Event object fired on Event.js shake @@ -524,14 +525,14 @@ }, /** - * Method that defines the actions when mouse is hovering the canvas. - * The currentTransform parameter will definde whether the user is rotating/scaling/translating - * an image or neither of them (only hovering). A group selection is also possible and would cancel - * all any other type of action. - * In case of an image transformation only the top canvas will be rendered. - * @private - * @param {Event} e Event object fired on mousemove - */ + * Method that defines the actions when mouse is hovering the canvas. + * The currentTransform parameter will definde whether the user is rotating/scaling/translating + * an image or neither of them (only hovering). A group selection is also possible and would cancel + * all any other type of action. + * In case of an image transformation only the top canvas will be rendered. + * @private + * @param {Event} e Event object fired on mousemove + */ __onMouseMove: function (e) { var target, pointer; diff --git a/src/mixins/canvas_gestures.mixin.js b/src/mixins/canvas_gestures.mixin.js index f11784d7..f2deaa17 100644 --- a/src/mixins/canvas_gestures.mixin.js +++ b/src/mixins/canvas_gestures.mixin.js @@ -64,6 +64,7 @@ this.renderAll(); t.action = 'drag'; }, + /** * Method that defines actions when an Event.js drag is detected. * @@ -75,6 +76,7 @@ e: e, self: self }); }, + /** * Method that defines actions when an Event.js orientation event is detected. * @@ -86,6 +88,7 @@ e: e, self: self }); }, + /** * Method that defines actions when an Event.js shake event is detected. * @@ -97,6 +100,7 @@ e: e, self: self }); }, + /** * Method that defines actions when an Event.js longpress event is detected. * @@ -108,6 +112,7 @@ e: e, self: self }); }, + /** * Scales an object by a factor * @param {Number} s The scale factor to apply to the current scale level @@ -141,6 +146,7 @@ target.setPositionByOrigin(constraintPosition, t.originX, t.originY); }, + /** * Rotates object by an angle * @param {Number} curAngle The angle of rotation in degrees diff --git a/src/mixins/itext_behavior.mixin.js b/src/mixins/itext_behavior.mixin.js index 4fb6879f..d650e321 100644 --- a/src/mixins/itext_behavior.mixin.js +++ b/src/mixins/itext_behavior.mixin.js @@ -379,8 +379,8 @@ }, /** - * Initializes "mousemove" event handler - */ + * Initializes "mousemove" event handler + */ initMouseMoveHandler: function() { var _this = this; this.canvas.on('mouse:move', function(options) { diff --git a/src/parser.js b/src/parser.js index e991b295..46d1bdf3 100644 --- a/src/parser.js +++ b/src/parser.js @@ -341,6 +341,7 @@ } return selectors.length === 0; } + /** * @private */ @@ -574,9 +575,9 @@ var svgCache = { /** - * @param {String} name - * @param {Function} callback - */ + * @param {String} name + * @param {Function} callback + */ has: function (name, callback) { callback(false); }, diff --git a/src/shapes/group.class.js b/src/shapes/group.class.js index aa91a886..ff0349ca 100644 --- a/src/shapes/group.class.js +++ b/src/shapes/group.class.js @@ -285,12 +285,13 @@ * object. * @param {fabric.Object} object * @return {fabric.Object} transformedObject - */ + */ realizeTransform: function(object) { this._moveFlippedObject(object); this._setObjectPosition(object); return object; }, + /** * Moves a flipped object to the position where it's displayed * @private diff --git a/src/shapes/image.class.js b/src/shapes/image.class.js index e6a2c66c..5cb38931 100644 --- a/src/shapes/image.class.js +++ b/src/shapes/image.class.js @@ -362,6 +362,7 @@ } return canvasEl; }, + /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on @@ -395,6 +396,7 @@ this._renderStroke(ctx); }, + /** * @private, needed to check if image needs resize */ diff --git a/src/shapes/itext.class.js b/src/shapes/itext.class.js index 54af77fd..2b324c4f 100644 --- a/src/shapes/itext.class.js +++ b/src/shapes/itext.class.js @@ -303,9 +303,9 @@ }, /** - * @private - * @param {CanvasRenderingContext2D} ctx Context to render on - */ + * @private + * @param {CanvasRenderingContext2D} ctx Context to render on + */ _render: function(ctx) { this.callSuper('_render', ctx); this.ctx = ctx; @@ -367,7 +367,7 @@ * Returns complete style of char at the current cursor * @param {Number} lineIndex Line index * @param {Number} charIndex Char index - * @return {Object} Character style + * @return {Object} Character style */ getCurrentCharStyle: function(lineIndex, charIndex) { var style = this.styles[lineIndex] && this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)]; diff --git a/src/util/animate.js b/src/util/animate.js index c0b33f07..7d2c0d16 100644 --- a/src/util/animate.js +++ b/src/util/animate.js @@ -55,13 +55,14 @@ function(callback) { fabric.window.setTimeout(callback, 1000 / 60); }; + /** - * requestAnimationFrame polyfill based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - * In order to get a precise start time, `requestAnimFrame` should be called as an entry into the method - * @memberOf fabric.util - * @param {Function} callback Callback to invoke - * @param {DOMElement} element optional Element to associate with animation - */ + * requestAnimationFrame polyfill based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + * In order to get a precise start time, `requestAnimFrame` should be called as an entry into the method + * @memberOf fabric.util + * @param {Function} callback Callback to invoke + * @param {DOMElement} element optional Element to associate with animation + */ function requestAnimFrame() { return _requestAnimFrame.apply(fabric.window, arguments); } diff --git a/src/util/arc.js b/src/util/arc.js index e4d4290e..a9c6a7e8 100644 --- a/src/util/arc.js +++ b/src/util/arc.js @@ -96,8 +96,8 @@ } /* - * Private - */ + * Private + */ function calcVectorAngle(ux, uy, vx, vy) { var ta = Math.atan2(uy, ux), tb = Math.atan2(vy, vx); diff --git a/src/util/dom_misc.js b/src/util/dom_misc.js index 5f1e90a2..096ccae2 100644 --- a/src/util/dom_misc.js +++ b/src/util/dom_misc.js @@ -182,12 +182,12 @@ } /** - * Returns style attribute value of a given element - * @memberOf fabric.util - * @param {HTMLElement} element Element to get style attribute for - * @param {String} attr Style attribute to get for element - * @return {String} Style attribute value of the given element. - */ + * Returns style attribute value of a given element + * @memberOf fabric.util + * @param {HTMLElement} element Element to get style attribute for + * @param {String} attr Style attribute to get for element + * @return {String} Style attribute value of the given element. + */ var getElementStyle; if (fabric.document.defaultView && fabric.document.defaultView.getComputedStyle) { getElementStyle = function(element, attr) { diff --git a/src/util/misc.js b/src/util/misc.js index 850a2eb2..0ad64867 100644 --- a/src/util/misc.js +++ b/src/util/misc.js @@ -179,12 +179,12 @@ }, /** - * Returns klass "Class" object of given namespace - * @memberOf fabric.util - * @param {String} type Type of object (eg. 'circle') - * @param {String} namespace Namespace to get klass "Class" object from - * @return {Object} klass "Class" - */ + * Returns klass "Class" object of given namespace + * @memberOf fabric.util + * @param {String} type Type of object (eg. 'circle') + * @param {String} namespace Namespace to get klass "Class" object from + * @return {Object} klass "Class" + */ getKlass: function(type, namespace) { // capitalize first letter only type = fabric.util.string.camelize(type.charAt(0).toUpperCase() + type.slice(1));