Skip to content

Commit

Permalink
Merge pull request #254 from nextcloud/dropdown_options
Browse files Browse the repository at this point in the history
Dropdown options for social media and instant messaging updated, placeholders changed to username
  • Loading branch information
jancborchardt authored Jul 13, 2017
2 parents aa28aa5 + 25437b9 commit 376f2f6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ js/public
js/vendor
coverage
npm-debug.log
package-lock.json
17 changes: 11 additions & 6 deletions js/services/vCardProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ angular.module('contactsApp')
impp: {
multiple: true,
readableName: t('contacts', 'Instant messaging'),
template: 'text',
template: 'username',
defaultValue: {
value:[''],
meta:{type:['HOME']}
meta:{type:['SKYPE']}
},
options: [
{id: 'HOME', name: t('contacts', 'Home')},
{id: 'WORK', name: t('contacts', 'Work')},
{id: 'OTHER', name: t('contacts', 'Other')}
{id: 'IRC', name: 'IRC'},
{id: 'SKYPE', name:'Skype'},
{id: 'TELEGRAM', name:'Telegram'}
]
},
tel: {
Expand All @@ -124,14 +124,19 @@ angular.module('contactsApp')
'X-SOCIALPROFILE': {
multiple: true,
readableName: t('contacts', 'Social network'),
template: 'text',
template: 'username',
defaultValue: {
value:[''],
meta:{type:['facebook']}
},
options: [
{id: 'FACEBOOK', name: 'Facebook'},
{id: 'GOOGLEPLUS', name: 'Google+'},
{id: 'INSTAGRAM', name: 'Instagram'},
{id: 'LINKEDIN', name: 'LinkedIn'},
{id: 'PINTEREST', name: 'Pinterest'},
{id: 'TWITTER', name: 'Twitter'}

]

}
Expand Down
11 changes: 11 additions & 0 deletions templates/detailItems/username.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<select ng-if="ctrl.availableOptions.length > 0" ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)">
<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>
<input type="text" id="details-{{ctrl.name}}-{{ctrl.index}}" name="{{ctrl.name}}"
ng-model="ctrl.data.value" ng-model-options="{ debounce: 500 }"
ng-change="ctrl.model.updateContact()" value=""
placeholder="Username"
focus-expression="$parent.ctrl.focus === ctrl.name"
/>
<button ng-click="ctrl.deleteField()" class="icon-delete" title="{{ctrl.t.delete}}"></button>

0 comments on commit 376f2f6

Please sign in to comment.