diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-10-26 18:31:25 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-11-21 15:55:03 +0100 |
commit | 01d8256338bf5fa8bd3b3bae2b251747299da7a2 (patch) | |
tree | 771091b50a14a403d412da8c5db90db35f3d9db1 /js | |
parent | 72b9423550f2c7fba116abfa3d8e407a88fedf48 (diff) |
Init addressbook disabling ability
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/components/addressBook/addressBook_controller.js | 10 | ||||
-rw-r--r-- | js/models/addressBook_model.js | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/js/components/addressBook/addressBook_controller.js b/js/components/addressBook/addressBook_controller.js index c06ea2e3..73b010f0 100644 --- a/js/components/addressBook/addressBook_controller.js +++ b/js/components/addressBook/addressBook_controller.js @@ -12,10 +12,13 @@ angular.module('contactsApp') shareInputPlaceHolder: t('contacts', 'Share with users or groups'), delete: t('contacts', 'Delete'), canEdit: t('contacts', 'can edit'), - close: t('contacts', 'Close') + close: t('contacts', 'Close'), + enabled: t('contacts', 'Enabled'), + disabled: t('contacts', 'Disabled') }; ctrl.editing = false; + ctrl.enabled = ctrl.addressBook.enabled; ctrl.tooltipIsOpen = false; ctrl.tooltipTitle = ctrl.t.clickToCopy; @@ -189,4 +192,9 @@ angular.module('contactsApp') }); }; + ctrl.toggleState = function() { + window.localStorage.setItem('ctrl.key', !ctrl.enabled); + ctrl.enabled = !ctrl.enabled; + }; + }); diff --git a/js/models/addressBook_model.js b/js/models/addressBook_model.js index 1be20c7e..de58e8ca 100644 --- a/js/models/addressBook_model.js +++ b/js/models/addressBook_model.js @@ -8,6 +8,10 @@ angular.module('contactsApp') contacts: [], groups: data.data.props.groups, readOnly: data.data.props.readOnly === '1', + // use only owner and url, convert ''/remote.php/dav/addressbooks/users/admin/Test1/'' to 'admin.Test' + key: data.data.href.split('/').splice(-3, 2).join('.'), + enabled: window.localStorage.getItem(this.key) !== false, + sharedWith: { users: [], groups: [] |