mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Show property as preferred if parameter PREF is set or parameter TYPE
contains PREF.
This commit is contained in:
parent
e8773cd627
commit
4e89e9e90e
@ -1446,13 +1446,13 @@ OC.Contacts = OC.Contacts || {};
|
||||
property.parameters.TYPE.push(property.label);
|
||||
meta.push(property.label);
|
||||
}
|
||||
var preferred = false;
|
||||
for(var param in property.parameters) {
|
||||
if(property.parameters.hasOwnProperty(param)) {
|
||||
//console.log('param', param);
|
||||
if(param.toUpperCase() === 'PREF') {
|
||||
var $cb = $property.find('input[type="checkbox"]');
|
||||
$cb.attr('checked', 'checked');
|
||||
meta.push($cb.attr('title'));
|
||||
preferred = true;
|
||||
continue;
|
||||
}
|
||||
else if(param.toUpperCase() === 'TYPE') {
|
||||
for(var etype in property.parameters[param]) {
|
||||
@ -1462,6 +1462,10 @@ OC.Contacts = OC.Contacts || {};
|
||||
if(typeof et !== 'string') {
|
||||
continue;
|
||||
}
|
||||
if(et.toUpperCase() === 'PREF') {
|
||||
preferred = true;
|
||||
continue;
|
||||
}
|
||||
$property.find('select.type option').each(function() {
|
||||
if($(this).val().toUpperCase() === et.toUpperCase()) {
|
||||
$(this).attr('selected', 'selected');
|
||||
@ -1481,6 +1485,11 @@ OC.Contacts = OC.Contacts || {};
|
||||
}
|
||||
}
|
||||
}
|
||||
if(preferred) {
|
||||
var $cb = $property.find('input[type="checkbox"]');
|
||||
$cb.attr('checked', 'checked');
|
||||
meta.push($cb.attr('title'));
|
||||
}
|
||||
var $meta = $property.find('.meta');
|
||||
if($meta.length) {
|
||||
$meta.html(meta.join('/'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user