Sha256: a011aa8e2fe2c06579cefb7f8dbfe6fc7b45d7e0638824430b9c170763f4c5fa

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

//= require ./vendor/jquery
//= require ./vendor/foundation
//= require ./vendor/handlebars
//= require ./vendor/sweetalert
//= require ./vendor/sortable
//= require tinymce-jquery
//= require_directory .

(function() {
  var token = $('meta[name="csrf-token"]').attr('content');

  $.ajaxSetup({
    beforeSend: function(xhr) {
      xhr.setRequestHeader('X-CSRF-Token', token);
    }
  });

  return token;
})();

jQuery(document).foundation();

jQuery(document).ready(function($) {
  $('#menu-toggle').click(function(e) {
    e.preventDefault();
    $('#wrapper').toggleClass('toggled');

    if ($('#wrapper').hasClass('toggled')) {
      $(this).find('i').removeClass('fa-angle-left');
      $(this).find('i').addClass('fa-angle-right');
    } else {
      $(this).find('i').removeClass('fa-angle-right');
      $(this).find('i').addClass('fa-angle-left');
    }
  });

  $('.destroy_resource').on('click', function(e) {
    e.preventDefault();

    $that = $(this);

    swal({
      title: 'Are you sure?',
      text: 'You will not be able to recover this after deleting...',
      type: 'warning',
      showCancelButton: true,
      confirmButtonColor: '#DD6B55',
      confirmButtonText: 'Yes, delete it!',
      closeOnConfirm: true
    }, function() {
      $that.parent().find('form').trigger('submit');
    });
  });
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
guts-1.4.0 app/assets/javascripts/guts/application.js.erb
guts-1.3.6 app/assets/javascripts/guts/application.js.erb
guts-1.3.5 app/assets/javascripts/guts/application.js.erb