(js) Fix id assignation of new Calendar
This commit is contained in:
parent
eeec8328c0
commit
1e784e4590
|
@ -386,6 +386,8 @@
|
||||||
* @returns a promise of the calendar id
|
* @returns a promise of the calendar id
|
||||||
*/
|
*/
|
||||||
Calendar.prototype.$id = function() {
|
Calendar.prototype.$id = function() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
// Object already unwrapped
|
// Object already unwrapped
|
||||||
return Calendar.$q.when(this.id);
|
return Calendar.$q.when(this.id);
|
||||||
|
@ -393,6 +395,7 @@
|
||||||
else {
|
else {
|
||||||
// Wait until object is unwrapped
|
// Wait until object is unwrapped
|
||||||
return this.$futureCalendarData.then(function(calendar) {
|
return this.$futureCalendarData.then(function(calendar) {
|
||||||
|
_this.id = calendar.id;
|
||||||
return calendar.id;
|
return calendar.id;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue