mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Cleanup .bind(
This commit is contained in:
parent
9ec84baa32
commit
29fe73d4e7
7 changed files with 143 additions and 246 deletions
|
|
@ -90,7 +90,7 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
|
||||
this.bDropPageAfterDelete = false;
|
||||
|
||||
// this.saveCommandDebounce = _.debounce(this.saveCommand.bind(this), 1000);
|
||||
// this.saveCommandDebounce = this.saveCommand.bind(this).debounce(1000);
|
||||
|
||||
const
|
||||
// propertyFocused = property => !property.isValid() && !property.focused(),
|
||||
|
|
@ -382,26 +382,18 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
|
||||
deleteSelectedContacts() {
|
||||
if (this.contactsCheckedOrSelected().length) {
|
||||
Remote.contactsDelete(this.deleteResponse.bind(this), this.contactsCheckedOrSelectedUids());
|
||||
Remote.contactsDelete((iError, oData) => {
|
||||
if (500 < (!iError && oData && oData.Time ? pInt(oData.Time) : 0)) {
|
||||
this.reloadContactList(this.bDropPageAfterDelete);
|
||||
} else {
|
||||
setTimeout(() => this.reloadContactList(this.bDropPageAfterDelete), 500);
|
||||
}
|
||||
}, this.contactsCheckedOrSelectedUids());
|
||||
|
||||
this.removeCheckedOrSelectedContactsFromList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {int} iError
|
||||
* @param {FetchJsonDefaultResponse} oData
|
||||
*/
|
||||
deleteResponse(iError, oData) {
|
||||
if (500 < (!iError && oData && oData.Time ? pInt(oData.Time) : 0)) {
|
||||
this.reloadContactList(this.bDropPageAfterDelete);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.reloadContactList(this.bDropPageAfterDelete);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
removeProperty(oProp) {
|
||||
this.viewProperties.remove(oProp);
|
||||
delegateRunOnDestroy(oProp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue