Hotfix: improve modal calling within the system

Signed-off-by: Alan Peterson Carvalho Silva's avatarAlanPCS <apcsilva@inf.ufpr.br>
parent f784aeac
......@@ -144,10 +144,21 @@ $(document).ready(function () {
});
});
// Modals
var modal_options = {
dismissible: true, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
}
$('.logout-icon').click(function (event) {
$('#logout_modal').modal();
$('#logout_modal').modal(modal_options);
});
$(".has-modal").click(function (event) {
$(`${this.hash}`).modal(modal_options);
});
$('#edit_user_button').click(function (event) {
event.preventDefault();
......@@ -209,44 +220,6 @@ $(document).ready(function () {
$('select').wrap('<div class="field-select">');
if($(".update_service").size() > 0) {
$('.update_service').modal({
dismissible: true, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
});
}
if($(".update_citizen_schedule").size() > 0) {
$('.update_citizen_schedule').modal({
dismissible: true, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
});
}
if($(".remove-shift-confirmation").size() > 0){
$('.remove-shift-confirmation').modal({
dismissible: true, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
})
}
if($(".modal_upload_citizen").size() > 0){
$('.modal_upload_citizen').modal({
dismissible: true, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
})
}
});
// Functions
......
......@@ -51,7 +51,9 @@
<a href="<%= edit_shift_path(shift) %>">
<i class="waves-effect material-icons tooltipped" data-position="top" data-delay="50" data-tooltip="Editar">edit</i>
</a>
<i class="waves-effect material-icons tooltipped modal-trigger remove-shift-confirmation" data-position="top" data-delay="50" data-tooltip="Excluir" href="#modal_remove_shift_<%=shift.id%>">delete</i>
<a class="waves-effect tooltipped modal-trigger has-modal" data-position="top" data-delay="50" data-tooltip="Excluir" href="#modal_remove_shift_<%=shift.id%>">
<i class="material-icons">delete</i>
</a>
</td>
</tr>
<% end %>
......
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