mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Contacts: Add group select to contact popup.
This commit is contained in:
parent
ccac1f9ab6
commit
0294d704a3
@ -638,8 +638,19 @@ OC.Contacts = OC.Contacts || {};
|
||||
* @return A jquery object to be inserted in the DOM
|
||||
*/
|
||||
Contact.prototype.renderContact = function(groupprops) {
|
||||
this.groupprops = groupprops;
|
||||
var self = this;
|
||||
this.groupprops = groupprops;
|
||||
|
||||
var buildGroupSelect = function($groupSelect, availableGroups) {
|
||||
$.each(availableGroups, function(idx, group) {
|
||||
var $option = $('<option value="' + group.id + '">' + group.name + '</option>');
|
||||
if(self.inGroup(group.name)) {
|
||||
$option.attr('selected', 'selected');
|
||||
}
|
||||
$groupSelect.append($option);
|
||||
});
|
||||
};
|
||||
|
||||
var n = this.getPreferredValue('N', ['', '', '', '', '']);
|
||||
//console.log('Contact.renderContact', this.data);
|
||||
var values = this.data
|
||||
@ -667,6 +678,11 @@ OC.Contacts = OC.Contacts || {};
|
||||
this.$fullelem.on('submit', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$groupSelect = this.$fullelem.find('#contactgroups');
|
||||
buildGroupSelect(this.$groupSelect, groupprops.groups);
|
||||
this.$groupSelect.multiSelect();
|
||||
|
||||
this.$addMenu = this.$fullelem.find('#addproperty');
|
||||
this.$addMenu.on('change', function(event) {
|
||||
//console.log('add', $(this).val());
|
||||
|
@ -173,6 +173,7 @@
|
||||
</ul>
|
||||
<a class="favorite action {favorite}"></a>
|
||||
</div>
|
||||
<select id="contactgroups" multiple></select>
|
||||
<div class="singleproperties">
|
||||
<input data-element="fn" class="fullname value propertycontainer" type="text" name="value" value="{name}" required />
|
||||
<a class="action edit"></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user