- Refactoring: Avoid unnecessary addEventListener false; change internal

jPicker function to class (used with `new`)
- Linting (ESLint): Add `valid-jsdoc` rule and make fixes; but turn off for
  now due to <https://github.com/eslint/eslint/issues/11036> and
  <https://github.com/eslint/eslint/issues/11037>
- Docs (JSDoc): Add some Markdown for variables, line breaks; tighten checks
  for overly generic types (though allow for `.Function` as in
  `jQuery.Function`) and avoid one previously missed instance
This commit is contained in:
Brett Zamir
2018-10-30 23:25:20 +08:00
parent 9b9c900ede
commit aef7b095ef
47 changed files with 1664 additions and 1441 deletions

View File

@@ -67,7 +67,7 @@ function getNewLayerName (existingLayerNames) {
}
/**
* This class encapsulates the concept of a SVG-edit drawing
* This class encapsulates the concept of a SVG-edit drawing.
*/
export class Drawing {
/**
@@ -184,7 +184,7 @@ export class Drawing {
}
/**
* Clears any previously set nonce
* Clears any previously set nonce.
* @returns {undefined}
*/
clearNonce () {
@@ -276,7 +276,7 @@ export class Drawing {
}
/**
* Check if layer with given name already exists
* Check if layer with given name already exists.
* @param {string} name - The layer name to check
* @returns {boolean}
*/
@@ -302,6 +302,7 @@ export class Drawing {
/**
* Get a layer by name.
* @param {string} name
* @returns {SVGGElement} The SVGGElement representing the named layer or null.
*/
getLayerByName (name) {
@@ -663,7 +664,7 @@ export class Drawing {
}
/**
* Create a clone of an element, updating its ID and its children's IDs when needed
* Create a clone of an element, updating its ID and its children's IDs when needed.
* @param {Element} el - DOM element to clone
* @returns {Element}
*/
@@ -767,7 +768,7 @@ export const init = function (canvas) {
};
/**
* Updates layer system
* Updates layer system.
* @function module:draw.identifyLayers
* @returns {undefined}
*/
@@ -980,7 +981,7 @@ export const mergeAllLayers = function (hrService) {
/**
* Return from a group context to the regular kind, make any previously
* disabled elements enabled again
* disabled elements enabled again.
* @function module:draw.leaveContext
* @fires module:svgcanvas.SvgCanvas#event:contextset
* @returns {undefined}
@@ -1006,7 +1007,7 @@ export const leaveContext = function () {
};
/**
* Set the current context (for in-group editing)
* Set the current context (for in-group editing).
* @function module:draw.setContext
* @param {Element} elem
* @fires module:svgcanvas.SvgCanvas#event:contextset