- Linting (ESLint): Stricter rules (or switch to warning)

- Breaking internal API change: `updateGripCursor` moved to be class method of Selector rather than instance method
- Breaking internal API change: `subpathIsClosed` moved to be class method of `Path` rather than instance method
- Refactoring: Reuse utilities base64 encoder for SVG icons plugin
- Docs (JSDoc): Fix return of the `mouseUp` (can also be an object) and `mouseDown` (may also be a boolean) of `pathActions`; other JSDoc additions/improvements
This commit is contained in:
Brett Zamir
2018-11-07 14:51:50 +08:00
parent 901c9547fe
commit 7c470e9909
126 changed files with 2081 additions and 1373 deletions

View File

@@ -139,7 +139,7 @@ export class Drawing {
const n = this.svgElem_.getAttributeNS(NS.SE, 'nonce');
// If already set in the DOM, use the nonce throughout the document
// else, if randomizeIds(true) has been called, create and set the nonce.
if (!!n && randIds !== RandomizeModes.NEVER_RANDOMIZE) {
if (n && randIds !== RandomizeModes.NEVER_RANDOMIZE) {
this.nonce_ = n;
} else if (randIds === RandomizeModes.ALWAYS_RANDOMIZE) {
this.setNonce(Math.floor(Math.random() * 100001));
@@ -253,7 +253,7 @@ export class Drawing {
return false;
}
// extract the obj_num of this id
const num = parseInt(id.substr(front.length), 10);
const num = parseInt(id.substr(front.length));
// if we didn't get a positive number or we already released this number
// then return false.
@@ -669,8 +669,8 @@ export class Drawing {
* @returns {Element}
*/
copyElem (el) {
const self = this;
const getNextIdClosure = function () { return self.getNextId(); };
const that = this;
const getNextIdClosure = function () { return that.getNextId(); };
return utilCopyElem(el, getNextIdClosure);
}
}