check click event for logout
This commit is contained in:
@@ -20,33 +20,33 @@ $(document).ready(function() {
|
|||||||
borderRadius: '0',
|
borderRadius: '0',
|
||||||
railBorderRadius: '0'
|
railBorderRadius: '0'
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.delete').click(function(){
|
// $('.delete').click(function(){
|
||||||
var method = $(this).attr('data-method');
|
// var method = $(this).attr('data-method');
|
||||||
var url = $(this).attr('data-ref');
|
// var url = $(this).attr('data-ref');
|
||||||
var html_text = $(this).siblings( "#delete_text" ).html();
|
// var html_text = $(this).siblings( "#delete_text" ).html();
|
||||||
//var page = url.substring(url.lastIndexOf('/') + 1);
|
// //var page = url.substring(url.lastIndexOf('/') + 1);
|
||||||
swal({
|
// swal({
|
||||||
title: "Confirmation",
|
// title: "Confirmation",
|
||||||
text: html_text,
|
// text: html_text,
|
||||||
type: "warning",
|
// type: "warning",
|
||||||
showCancelButton: true,
|
// showCancelButton: true,
|
||||||
confirmButtonColor: "#DD6B55",
|
// confirmButtonColor: "#DD6B55",
|
||||||
html: true
|
// html: true
|
||||||
}, function (isConfirm) {
|
// }, function (isConfirm) {
|
||||||
if (isConfirm) {
|
// if (isConfirm) {
|
||||||
$.ajax({
|
// $.ajax({
|
||||||
type: method,
|
// type: method,
|
||||||
url: url ,
|
// url: url ,
|
||||||
success: function(data) {
|
// success: function(data) {
|
||||||
location.href = data.url;
|
// location.href = data.url;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
// swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
// for Notificaiotn message
|
// for Notificaiotn message
|
||||||
var placementFrom = $("#notify_message").attr('data-placement-from');
|
var placementFrom = $("#notify_message").attr('data-placement-from');
|
||||||
|
|||||||
@@ -51,13 +51,11 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li>
|
<li>
|
||||||
<!-- <%if current_login_employee.role !="waiter" %> -->
|
|
||||||
<!-- <%end%> -->
|
|
||||||
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
||||||
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
||||||
<span class="font-18">Logout</span>
|
<span class="font-18">Logout</span>
|
||||||
</p> -->
|
</p> -->
|
||||||
<p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%= logout_path %>" data-method="delete">
|
<p class="delete waves-effect waves-block p-l-30 m-b-5 logout" data-ref="<%= logout_path %>" data-method="delete">
|
||||||
<i class="material-icons font-7 logout_icon">exit_to_app</i>
|
<i class="material-icons font-7 logout_icon">exit_to_app</i>
|
||||||
<span class="font-15">Logout</span>
|
<span class="font-15">Logout</span>
|
||||||
</p>
|
</p>
|
||||||
@@ -73,4 +71,35 @@
|
|||||||
</a> -->
|
</a> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
$('.delete').click(function(){
|
||||||
|
var method = $(this).attr('data-method');
|
||||||
|
var url = $(this).attr('data-ref');
|
||||||
|
var html_text = $(this).siblings( "#delete_text" ).html();
|
||||||
|
//var page = url.substring(url.lastIndexOf('/') + 1);
|
||||||
|
swal({
|
||||||
|
title: "Confirmation",
|
||||||
|
text: html_text,
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#DD6B55",
|
||||||
|
html: true
|
||||||
|
}, function (isConfirm) {
|
||||||
|
if (isConfirm) {
|
||||||
|
$.ajax({
|
||||||
|
type: method,
|
||||||
|
url: url ,
|
||||||
|
success: function(data) {
|
||||||
|
location.href = data.url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user