mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-19 03:49:28 +00:00
Handle attach URLs in appointment editor
This commit is contained in:
@@ -514,6 +514,41 @@
|
||||
this.attendees && this.attendees.length > 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function addAttachUrl
|
||||
* @memberof Component.prototype
|
||||
* @desc Add a new attach URL if not already defined
|
||||
* @param {string} attachUrl - the URL
|
||||
* @returns the number of values in the list of attach URLs
|
||||
*/
|
||||
Component.prototype.addAttachUrl = function(attachUrl) {
|
||||
if (angular.isUndefined(this.attachUrls)) {
|
||||
this.attachUrls = [{value: attachUrl}];
|
||||
}
|
||||
else {
|
||||
for (var i = 0; i < this.attachUrls.length; i++) {
|
||||
if (this.attachUrls[i].value == attachUrl) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == this.attachUrls.length)
|
||||
this.attachUrls.push({value: attachUrl});
|
||||
}
|
||||
return this.attachUrls.length - 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function deleteAttachUrl
|
||||
* @memberof Component.prototype
|
||||
* @desc Remove an attach URL
|
||||
* @param {number} index - the URL index in the list of attach URLs
|
||||
*/
|
||||
Component.prototype.deleteAttachUrl = function(index) {
|
||||
if (index > -1 && this.attachUrls.length > index) {
|
||||
this.attachUrls.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $reset
|
||||
* @memberof Component.prototype
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
vm.cardFilter = cardFilter;
|
||||
vm.cardResults = [];
|
||||
vm.addAttendee = addAttendee;
|
||||
vm.addAttachUrl = addAttachUrl;
|
||||
vm.cancel = cancel;
|
||||
vm.save = save;
|
||||
vm.attendeesEditor = {
|
||||
@@ -67,6 +68,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
function addAttachUrl() {
|
||||
var i = vm.component.addAttachUrl('');
|
||||
focus('attachUrl_' + i);
|
||||
};
|
||||
|
||||
function toggleRecurrenceEditor() {
|
||||
vm.showRecurrenceEditor = !vm.showRecurrenceEditor;
|
||||
vm.component.$hasCustomRepeat = vm.showRecurrenceEditor;
|
||||
|
||||
Reference in New Issue
Block a user