Commit 812220d0 authored by Zac Wood's avatar Zac Wood

Fix export modal not activating

parent 9eeb3c94
Pipeline #5149 canceled with stages
in 7 minutes and 58 seconds
......@@ -3,7 +3,7 @@ import { getCart } from 'src/cart'
import { buildUrl, downloadIcal } from '../utils'
export default class extends Controller {
static targets = ['schedule', 'loader', 'export']
static targets = ['schedule', 'loader', 'export', 'modal']
connect() {
if (getCart().length == 0) {
......@@ -30,4 +30,8 @@ export default class extends Controller {
openWebcal() {
window.open(buildUrl(`/api/schedules?crns=${getCart().join(',')}`, 'webcal:'))
}
showModal() {
$(this.modalTarget).modal('toggle')
}
}
......@@ -2,7 +2,7 @@
<div data-controller="schedule">
<h2 style="margin-bottom: 0.5em">Your Schedule</h2>
<button data-target="schedule.export" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal">
<button data-target="schedule.export" type="button" class="btn btn-primary" data-action="schedule#showModal">
Export Schedule to Calendar
</button>
<div>
......@@ -11,6 +11,7 @@
<div data-target="schedule.schedule"></div>
<div
data-target="schedule.modal"
class="modal fade"
id="exportModal"
tabindex="-1"
......
<%= javascript_pack_tag 'schedules_view' %>
<%= stylesheet_link_tag 'schedules' %>
<div id="root"></div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment