Skip to content

Commit eb30880

Browse files
committed
pat-calendar: Deactivate some more event-add related code paths if not needed.
1 parent 0badd14 commit eb30880

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/pat/calendar/calendar.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ export default Base.extend({
147147
];
148148
config.eventColor = opts.eventColor;
149149

150-
config.dateClick = this.addNewEvent.bind(this);
151-
152150
let lang =
153151
opts.lang ||
154152
document.querySelector("html").getAttribute("lang") ||
@@ -196,10 +194,13 @@ export default Base.extend({
196194
cal_el.setAttribute("class", "pat-calendar__fc");
197195
el.appendChild(cal_el);
198196

199-
// Create a element for modals/injections
200-
this.mod_el = document.createElement("section");
201-
this.mod_el.setAttribute("class", "pat-calendar__modal");
202-
el.appendChild(this.mod_el);
197+
if (opts.addUrl) {
198+
config.dateClick = this.addNewEvent.bind(this);
199+
// Create a element for modals/injections
200+
this.mod_el = document.createElement("section");
201+
this.mod_el.setAttribute("class", "pat-calendar__modal");
202+
el.appendChild(this.mod_el);
203+
}
203204

204205
let calendar = (this.calendar = new Calendar(cal_el, config));
205206
calendar.render();

0 commit comments

Comments
 (0)