diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2017-11-03 11:23:04 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2017-11-03 11:23:04 +0100 |
commit | 53267fcba58360cb0821f1d03af989069c09459e (patch) | |
tree | 3bb761ada6299f3582937dcac121629a0f9d44c2 | |
parent | 618003ca84b02717e6adcf02a033b8fe8115cded (diff) |
Fixed readOnly property and templates
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
-rw-r--r-- | js/models/contact_model.js | 1 | ||||
-rw-r--r-- | templates/detailItems/adr.html | 16 | ||||
-rw-r--r-- | templates/detailItems/date.html | 4 | ||||
-rw-r--r-- | templates/detailItems/email.html | 6 | ||||
-rw-r--r-- | templates/detailItems/groups.html | 2 | ||||
-rw-r--r-- | templates/detailItems/n.html | 12 | ||||
-rw-r--r-- | templates/detailItems/select.html | 4 | ||||
-rw-r--r-- | templates/detailItems/tel.html | 6 | ||||
-rw-r--r-- | templates/detailItems/text.html | 6 | ||||
-rw-r--r-- | templates/detailItems/textarea.html | 4 | ||||
-rw-r--r-- | templates/detailItems/url.html | 4 | ||||
-rw-r--r-- | templates/detailItems/username.html | 6 |
12 files changed, 36 insertions, 35 deletions
diff --git a/js/models/contact_model.js b/js/models/contact_model.js index 83562d22..ece54514 100644 --- a/js/models/contact_model.js +++ b/js/models/contact_model.js @@ -10,6 +10,7 @@ angular.module('contactsApp') dateProperties: ['bday', 'anniversary', 'deathdate'], addressBookId: addressBook.displayName, + readOnly: addressBook.readOnly, version: function() { var property = this.getProperty('version'); diff --git a/templates/detailItems/adr.html b/templates/detailItems/adr.html index 4d0ffb42..1e0789c4 100644 --- a/templates/detailItems/adr.html +++ b/templates/detailItems/adr.html @@ -1,36 +1,36 @@ -<select ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.model.addressBook.readOnly"> +<select ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.contact.readOnly"> <option ng-repeat="option in ctrl.availableOptions" value="{{option.id}}">{{option.name}}</option> </select> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> <div> <label for="details-pobox-{{ctrl.index}}">{{ctrl.t.poBox}}</label> <input type="text" id="details-pobox-{{ctrl.index}}" name="address" ng-model="ctrl.data.value[0]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-address-{{ctrl.index}}">{{ctrl.t.address}}</label> <input type="text" id="details-address-{{ctrl.index}}" name="address" ng-model="ctrl.data.value[2]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" value="" - ng-disabled="ctrl.model.addressBook.readOnly" + ng-disabled="ctrl.contact.readOnly" focus-expression="$parent.ctrl.focus === ctrl.name" /> </div> <div> <label for="details-postal-code-{{ctrl.index}}">{{ctrl.t.postalCode}}</label> <input type="text" id="details-postal-code-{{ctrl.index}}" name="postal-code" ng-model="ctrl.data.value[5]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-city-{{ctrl.index}}">{{ctrl.t.city}}</label> <input type="text" id="details-city-{{ctrl.index}}" name="city" ng-model="ctrl.data.value[3]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-state-{{ctrl.index}}">{{ctrl.t.state}}</label> <input type="text" id="details-state-{{ctrl.index}}" name="state" ng-model="ctrl.data.value[4]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-country-{{ctrl.index}}">{{ctrl.t.country}}</label> <input type="text" id="details-country-{{ctrl.index}}" name="state" ng-model="ctrl.data.value[6]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> diff --git a/templates/detailItems/date.html b/templates/detailItems/date.html index 8a43b098..b8761779 100644 --- a/templates/detailItems/date.html +++ b/templates/detailItems/date.html @@ -3,6 +3,6 @@ ng-model="ctrl.data.value" datepicker ng-model-options="{ debounce: 500 }" ng-change="ctrl.dateInputChanged()" value="" focus-expression="$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly" + ng-disabled="ctrl.contact.readOnly" /> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> diff --git a/templates/detailItems/email.html b/templates/detailItems/email.html index 0fd30e52..543ec32c 100644 --- a/templates/detailItems/email.html +++ b/templates/detailItems/email.html @@ -1,4 +1,4 @@ -<select ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.model.addressBook.readOnly"> +<select ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.contact.readOnly"> <option ng-repeat="option in ctrl.availableOptions" value="{{option.id}}">{{option.name}}</option> </select> <a ng-if="ctrl.data.value.length" class="item-action" href="mailto:{{ctrl.data.value}}"> @@ -9,6 +9,6 @@ ng-change="ctrl.updateContact()" value="" placeholder="{{ctrl.meta.readableName}}" focus-expression="$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly" + ng-disabled="ctrl.contact.readOnly" /> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> diff --git a/templates/detailItems/groups.html b/templates/detailItems/groups.html index b7e9a4e1..8da05fc5 100644 --- a/templates/detailItems/groups.html +++ b/templates/detailItems/groups.html @@ -2,7 +2,7 @@ <ui-select id="details-{{ctrl.name}}-{{ctrl.index}}" multiple tagging tagging-label="{{ctrl.t.newGroup}}" ng-model="ctrl.data.value" on-remove="ctrl.updateContact()" on-select="ctrl.updateContact()" theme="select2" focus-expression="$parent.$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly"> + ng-disabled="ctrl.contact.readOnly"> <ui-select-match placeholder="{{ctrl.meta.readableName}}">{{$item}}</ui-select-match> <ui-select-choices repeat="group in ctrl.availableGroups | filter:$select.search"> {{group}} diff --git a/templates/detailItems/n.html b/templates/detailItems/n.html index 67c584d0..15efde60 100644 --- a/templates/detailItems/n.html +++ b/templates/detailItems/n.html @@ -1,32 +1,32 @@ <label ng-if="ctrl.availableOptions.length === 0">{{ctrl.meta.readableName}}</label> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> <div> <label for="details-honorificPrefix-{{ctrl.index}}">{{ctrl.t.honorificPrefix}}</label> <input type="text" id="details-honorificPrefix-{{ctrl.index}}" name="honorificPrefix" ng-model="ctrl.data.value[3]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" autocomplete="off" autocorrect="off" spellcheck="false" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-firstName-{{ctrl.index}}">{{ctrl.t.firstName}}</label> <input type="text" id="details-firstName-{{ctrl.index}}" name="firstName" ng-model="ctrl.data.value[1]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" autocomplete="off" autocorrect="off" spellcheck="false" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-additionalNames-{{ctrl.index}}">{{ctrl.t.additionalNames}}</label> <input type="text" id="details-additionalNames-{{ctrl.index}}" name="additionalNames" ng-model="ctrl.data.value[2]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" autocomplete="off" autocorrect="off" spellcheck="false" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-familyName-{{ctrl.index}}">{{ctrl.t.familyName}}</label> <input type="text" id="details-familyName-{{ctrl.index}}" name="familyName" ng-model="ctrl.data.value[0]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" autocomplete="off" autocorrect="off" spellcheck="false" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> <div> <label for="details-honorificSuffix-{{ctrl.index}}">{{ctrl.t.honorificSuffix}}</label> <input type="text" id="details-honorificSuffix-{{ctrl.index}}" name="honorificSuffix" ng-model="ctrl.data.value[4]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" autocomplete="off" autocorrect="off" spellcheck="false" value="" - ng-disabled="ctrl.model.addressBook.readOnly" /> + ng-disabled="ctrl.contact.readOnly" /> </div> diff --git a/templates/detailItems/select.html b/templates/detailItems/select.html index 650fdb0f..64d583de 100644 --- a/templates/detailItems/select.html +++ b/templates/detailItems/select.html @@ -1,7 +1,7 @@ <label ng-if="ctrl.availableOptions.length > 0" for="details-{{ctrl.name}}">{{ctrl.meta.readableName}}</label> <select id="details-{{ctrl.name}}" name="{{ctrl.name}}" ng-if="ctrl.availableOptions.length > 0" ng-model="ctrl.data.value" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" - ng-disabled="ctrl.model.addressBook.readOnly"> + ng-disabled="ctrl.contact.readOnly"> <option ng-repeat="option in ctrl.availableOptions" value="{{option.id}}">{{option.name}}</option> </select> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> diff --git a/templates/detailItems/tel.html b/templates/detailItems/tel.html index 2b506efc..b3cf0253 100644 --- a/templates/detailItems/tel.html +++ b/templates/detailItems/tel.html @@ -1,4 +1,4 @@ -<select ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.model.addressBook.readOnly"> +<select ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.contact.readOnly"> <option ng-repeat="option in ctrl.availableOptions" value="{{option.id}}">{{option.name}}</option> </select> <a ng-if="ctrl.data.value.length" class="item-action" href="tel:{{ctrl.data.value}}"> @@ -9,6 +9,6 @@ ng-change="ctrl.updateContact()" value="" placeholder="{{ctrl.meta.readableName}}" focus-expression="$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly" + ng-disabled="ctrl.contact.readOnly" /> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> diff --git a/templates/detailItems/text.html b/templates/detailItems/text.html index b79fd84a..1c7873a6 100644 --- a/templates/detailItems/text.html +++ b/templates/detailItems/text.html @@ -1,4 +1,4 @@ -<select ng-if="ctrl.availableOptions.length > 0" ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.model.addressBook.readOnly"> +<select ng-if="ctrl.availableOptions.length > 0" ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.contact.readOnly"> <option ng-repeat="option in ctrl.availableOptions" value="{{option.id}}">{{option.name}}</option> </select> <label ng-if="ctrl.availableOptions.length === 0" for="details-{{ctrl.name}}-{{ctrl.index}}">{{ctrl.meta.readableName}}</label> @@ -7,6 +7,6 @@ ng-change="ctrl.updateContact()" value="" placeholder="{{ctrl.meta.readableName}}" focus-expression="$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly" + ng-disabled="ctrl.contact.readOnly" /> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> diff --git a/templates/detailItems/textarea.html b/templates/detailItems/textarea.html index 1232fad9..d3b1c3e8 100644 --- a/templates/detailItems/textarea.html +++ b/templates/detailItems/textarea.html @@ -4,6 +4,6 @@ ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateContact()" placeholder="{{ctrl.meta.readableName}}" focus-expression="$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly"> + ng-disabled="ctrl.contact.readOnly"> </textarea> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> diff --git a/templates/detailItems/url.html b/templates/detailItems/url.html index 32ecb40e..d39eba32 100644 --- a/templates/detailItems/url.html +++ b/templates/detailItems/url.html @@ -7,6 +7,6 @@ ng-change="ctrl.updateContact()" value="" placeholder="https://…" focus-expression="$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly" + ng-disabled="ctrl.contact.readOnly" /> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> diff --git a/templates/detailItems/username.html b/templates/detailItems/username.html index f4fa7183..59873584 100644 --- a/templates/detailItems/username.html +++ b/templates/detailItems/username.html @@ -1,4 +1,4 @@ -<select ng-if="ctrl.availableOptions.length > 0" ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.model.addressBook.readOnly"> +<select ng-if="ctrl.availableOptions.length > 0" ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)" ng-disabled="ctrl.contact.readOnly"> <option ng-repeat="option in ctrl.availableOptions" value="{{option.id}}">{{option.name}}</option> </select> <label ng-if="ctrl.availableOptions.length === 0" for="details-{{ctrl.name}}-{{ctrl.index}}">{{ctrl.meta.readableName}}</label> @@ -7,6 +7,6 @@ ng-change="ctrl.updateContact()" value="" placeholder="Username" focus-expression="$parent.ctrl.focus === ctrl.name" - ng-disabled="ctrl.model.addressBook.readOnly" + ng-disabled="ctrl.contact.readOnly" /> -<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.model.addressBook.readOnly"></button> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}" ng-if="!ctrl.contact.readOnly"></button> |