(feat) now able to copy/move events and also duplicate them (fixes #3196)

This commit is contained in:
Ludovic Marcotte
2016-03-24 14:53:27 -04:00
parent 01f9f68d88
commit 49f1c30e77
6 changed files with 174 additions and 56 deletions
@@ -1229,6 +1229,28 @@
return localizedString;
};
/**
* @function copyTo
* @memberof Component.prototype
* @desc Copy an event to a calendar
* @param {string} calendar - a target calendar UID
* @returns a promise of the HTTP operation
*/
Component.prototype.copyTo = function(calendar) {
return Component.$$resource.post(this.pid + '/' + this.id, 'copy', {destination: calendar});
};
/**
* @function moveTo
* @memberof Component.prototype
* @desc Move an event to a calendar
* @param {string} calendar - a target calendar UID
* @returns a promise of the HTTP operation
*/
Component.prototype.moveTo = function(calendar) {
return Component.$$resource.post(this.pid + '/' + this.id, 'move', {destination: calendar});
};
Component.prototype.toString = function() {
return '[Component ' + this.id + ']';
};