- Linting: As per latest ash-nazg (unicorn updates)

- npm: Update devDeps.
This commit is contained in:
Brett Zamir
2020-07-19 22:32:40 +08:00
parent b620eb55bb
commit 54fd0975d7
19 changed files with 121 additions and 159 deletions

View File

@@ -8,7 +8,10 @@
* @param {PlainObject} [strings.cancel]
* @returns {external:jQuery}
*/
export default function jQueryPluginDBox ($, strings = {ok: 'Ok', cancel: 'Cancel'}) {
export default function jQueryPluginDBox ($, {
ok: okString = 'Ok',
cancel: cancelString = 'Cancel'
} = {}) {
// This sets up alternative dialog boxes. They mostly work the same way as
// their UI counterparts, expect instead of returning the result, a callback
// needs to be included that returns the result as its first parameter.
@@ -72,11 +75,11 @@ export default function jQueryPluginDBox ($, strings = {ok: 'Ok', cancel: 'Cance
.toggleClass('prompt', (type === 'prompt'));
btnHolder.empty();
const ok = $('<input type="button" data-ok="" value="' + strings.ok + '">').appendTo(btnHolder);
const ok = $('<input type="button" data-ok="" value="' + okString + '">').appendTo(btnHolder);
return new Promise((resolve, reject) => { // eslint-disable-line promise/avoid-new
if (type !== 'alert') {
$('<input type="button" value="' + strings.cancel + '">')
$('<input type="button" value="' + cancelString + '">')
.appendTo(btnHolder)
.click(function () {
box.hide();

View File

@@ -158,7 +158,6 @@ export class Drawing {
return this.svgElem_.querySelector('#' + id);
}
// jQuery lookup: twice as slow as xpath in FF
// eslint-disable-next-line unicorn/no-fn-reference-in-iterator
return $(this.svgElem_).find('[id=' + id + ']')[0];
}