Fixed announcement JavaScript functionality
This commit is contained in:
parent
8a8c2667de
commit
c76f839ea7
|
@ -73,13 +73,13 @@ _ready = ->
|
|||
lineColor: bodyColor
|
||||
density: 23000
|
||||
|
||||
$(".alert-announcement").each ->
|
||||
$(".announcement").each ->
|
||||
aId = $(this)[0].dataset.announcementId
|
||||
unless (window.localStorage.getItem("announcement#{aId}"))
|
||||
$(this).toggleClass("hidden")
|
||||
$(this).toggleClass("d-none")
|
||||
|
||||
$(document).on "click", ".alert-announcement button.close", (evt) ->
|
||||
announcement = event.target.closest(".alert-announcement")
|
||||
$(document).on "click", ".announcement button.close", (evt) ->
|
||||
announcement = event.target.closest(".announcement")
|
||||
aId = announcement.dataset.announcementId
|
||||
window.localStorage.setItem("announcement#{aId}", true)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.announcement__container
|
||||
- @active_announcements.each do |announcement|
|
||||
.alert.announcement.alert-info.alert-dismissable.hidden{ data: { 'announcement-id': announcement.id } }
|
||||
.alert.announcement.alert-info.alert-dismissable.d-none{ data: { 'announcement-id': announcement.id } }
|
||||
.container
|
||||
%button.close{ type: "button", "data-dismiss" => "alert" }
|
||||
%span{ "aria-hidden" => "true" } ×
|
||||
|
|
Loading…
Reference in New Issue