update delete click
This commit is contained in:
@@ -16,7 +16,6 @@
|
|||||||
//= require bootstrap/js/popper.min
|
//= require bootstrap/js/popper.min
|
||||||
//= require bootstrap/js/bootstrap-material-design.min
|
//= require bootstrap/js/bootstrap-material-design.min
|
||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
//= require jquery-confirm
|
|
||||||
//= require turbolinks
|
//= require turbolinks
|
||||||
//= require cable
|
//= require cable
|
||||||
//= require settings/processing_items
|
//= require settings/processing_items
|
||||||
@@ -140,9 +139,11 @@ $(function(){
|
|||||||
$('.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 = $( this ).siblings( "#delete_text" ).html();
|
||||||
|
console.log(html);
|
||||||
swal({
|
swal({
|
||||||
title: "Confirmation",
|
title: "Confirmation",
|
||||||
text: $('#delete_text').html(),
|
text: html,
|
||||||
type: "warning",
|
type: "warning",
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: "#DD6B55",
|
confirmButtonColor: "#DD6B55",
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ Search Bar -->
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- Start Delete confirrm text !-->
|
<!-- Start Delete confirrm text !-->
|
||||||
<span class="hidden" id="delete_text">
|
|
||||||
<h6>Are you sure you want to Logout ?</h6>
|
|
||||||
<!-- <h6>This action can't be undo. </h6> -->
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div class="navbar-right">
|
<div class="navbar-right">
|
||||||
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||||
@@ -38,7 +35,11 @@ Search Bar -->
|
|||||||
<%= link_to (t :logout),logout_path, method: :delete, data: {confirm: 'Are you sure?'} %>
|
<%= link_to (t :logout),logout_path, method: :delete, data: {confirm: 'Are you sure?'} %>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
||||||
<p class="delete" style="" data-ref="<%=logout_path%>" data-method="delete">Logout</a>
|
<p class="delete" style="" data-ref="<%=logout_path%>" data-method="delete">Logout</p>
|
||||||
|
<span class="hidden" id="delete_text">
|
||||||
|
<h6>Are you sure you want to Logout ?</h6>
|
||||||
|
<!-- <h6>This action can't be undo. </h6> -->
|
||||||
|
</span>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user