Remove utilAsync
This commit is contained in:
parent
0ebf676305
commit
7f9a73135d
@ -35,16 +35,16 @@ async function profileOptionsSetup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function profileOptionsSetupEventListeners() {
|
function profileOptionsSetupEventListeners() {
|
||||||
$('#profile-target').change(utilAsync(onTargetProfileChanged));
|
$('#profile-target').change((e) => onTargetProfileChanged(e));
|
||||||
$('#profile-name').change(onProfileNameChanged);
|
$('#profile-name').change(onProfileNameChanged);
|
||||||
$('#profile-add').click(utilAsync(onProfileAdd));
|
$('#profile-add').click((e) => onProfileAdd(e));
|
||||||
$('#profile-remove').click(utilAsync(onProfileRemove));
|
$('#profile-remove').click((e) => onProfileRemove(e));
|
||||||
$('#profile-remove-confirm').click(utilAsync(onProfileRemoveConfirm));
|
$('#profile-remove-confirm').click((e) => onProfileRemoveConfirm(e));
|
||||||
$('#profile-copy').click(utilAsync(onProfileCopy));
|
$('#profile-copy').click((e) => onProfileCopy(e));
|
||||||
$('#profile-copy-confirm').click(utilAsync(onProfileCopyConfirm));
|
$('#profile-copy-confirm').click((e) => onProfileCopyConfirm(e));
|
||||||
$('#profile-move-up').click(() => onProfileMove(-1));
|
$('#profile-move-up').click(() => onProfileMove(-1));
|
||||||
$('#profile-move-down').click(() => onProfileMove(1));
|
$('#profile-move-down').click(() => onProfileMove(1));
|
||||||
$('.profile-form').find('input, select, textarea').not('.profile-form-manual').change(utilAsync(onProfileOptionsChanged));
|
$('.profile-form').find('input, select, textarea').not('.profile-form-manual').change((e) => onProfileOptionsChanged(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
function tryGetIntegerValue(selector, min, max) {
|
function tryGetIntegerValue(selector, min, max) {
|
||||||
|
@ -155,8 +155,8 @@ async function formWrite(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formSetupEventListeners() {
|
function formSetupEventListeners() {
|
||||||
$('input, select, textarea').not('.anki-model').not('.ignore-form-changes *').change(utilAsync(onFormOptionsChanged));
|
$('input, select, textarea').not('.anki-model').not('.ignore-form-changes *').change((e) => onFormOptionsChanged(e));
|
||||||
$('.anki-model').change(utilAsync(onAnkiModelChanged));
|
$('.anki-model').change((e) => onAnkiModelChanged(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
function formUpdateVisibility(options) {
|
function formUpdateVisibility(options) {
|
||||||
@ -219,7 +219,7 @@ async function onReady() {
|
|||||||
chrome.runtime.onMessage.addListener(onMessage);
|
chrome.runtime.onMessage.addListener(onMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(utilAsync(onReady));
|
$(document).ready(() => onReady());
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -582,7 +582,7 @@ async function ankiFieldsPopulate(element, options) {
|
|||||||
container.append($(html));
|
container.append($(html));
|
||||||
}
|
}
|
||||||
|
|
||||||
tab.find('.anki-field-value').change(utilAsync(onFormOptionsChanged));
|
tab.find('.anki-field-value').change((e) => onFormOptionsChanged(e));
|
||||||
tab.find('.marker-link').click(onAnkiMarkerClicked);
|
tab.find('.marker-link').click(onAnkiMarkerClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,12 +16,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function utilAsync(func) {
|
|
||||||
return function(...args) {
|
|
||||||
func.apply(this, args);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function utilIsolate(data) {
|
function utilIsolate(data) {
|
||||||
return JSON.parse(JSON.stringify(data));
|
return JSON.parse(JSON.stringify(data));
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function utilAsync(func) {
|
|
||||||
return function(...args) {
|
|
||||||
func.apply(this, args);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function utilInvoke(action, params={}) {
|
function utilInvoke(action, params={}) {
|
||||||
const data = {action, params};
|
const data = {action, params};
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user