Skip to content

Commit

Permalink
fix: script error when calendar list is not set(refs: #81) (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
홍유정 authored May 23, 2018
1 parent 005fc29 commit 806d183
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/js/view/popup/scheduleCreationPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ ScheduleCreationPopup.prototype._onClickSaveSchedule = function(target) {
var className = config.classname('popup-save');
var cssPrefix = config.cssPrefix;
var title, isPrivate, location, isAllDay, startDate, endDate, state;
var start, end;
var start, end, calendarId;

if (!domutil.hasClass(target, className) && !domutil.closest(target, '.' + className)) {
return false;
Expand Down Expand Up @@ -278,10 +278,14 @@ ScheduleCreationPopup.prototype._onClickSaveSchedule = function(target) {
start = new TZDate(startDate);
end = new TZDate(endDate);

if (this._selectedCal) {
calendarId = this._selectedCal.id;
}

if (this._isEditMode) {
this.fire('beforeUpdateSchedule', {
schedule: {
calendarId: this._selectedCal.id,
calendarId: calendarId,
title: title.value,
raw: {
class: isPrivate ? 'private' : 'public',
Expand All @@ -306,7 +310,7 @@ ScheduleCreationPopup.prototype._onClickSaveSchedule = function(target) {
* @property {Schedule} schedule - new schedule instance to be added
*/
this.fire('beforeCreateSchedule', {
calendarId: this._selectedCal.id,
calendarId: calendarId,
title: title.value,
raw: {
class: isPrivate ? 'private' : 'public',
Expand Down

0 comments on commit 806d183

Please sign in to comment.