From 91e76c738132e02d25de01dbf0e961574fa7a8f0 Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 9 Mar 2018 13:29:24 +0630 Subject: [PATCH] check click event for logout --- app/assets/javascripts/custom.js | 54 +++++++++++++++--------------- app/views/layouts/_header.html.erb | 37 +++++++++++++++++--- 2 files changed, 60 insertions(+), 31 deletions(-) diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index f33f6d11..a2011022 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -20,33 +20,33 @@ $(document).ready(function() { borderRadius: '0', railBorderRadius: '0' }); - - $('.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"); - } - }); - }); + + // $('.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"); + // } + // }); + // }); // for Notificaiotn message var placementFrom = $("#notify_message").attr('data-placement-from'); diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 2207fef7..d07da974 100755 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -51,13 +51,11 @@ <% end %>
  • - - -

    +

    exit_to_app Logout

    @@ -73,4 +71,35 @@ --> - \ No newline at end of file + + + \ No newline at end of file