Sha256: 6b9f482da054d325389987b6fc984c61acfaaf710b72f7b9c164e34138a37c6f

Contents?: true

Size: 1.64 KB

Versions: 6

Compression:

Stored size: 1.64 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');
    });
  });

  $('.toggle-tinymce').on('click', function(e) {
    e.preventDefault();

    var editorID = $(this).data('editor-id');
    var editor   = tinymce.EditorManager.get(editorID);

    if (editor) {
      editor.remove();
    } else {
      editor = tinymce.EditorManager.createEditor(editorID, tinyMCE.settings);
      editor.render();
    }
  });
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
guts-3.0.1 app/assets/javascripts/guts/application.js.erb
guts-3.0.0 app/assets/javascripts/guts/application.js.erb
guts-2.1.0 app/assets/javascripts/guts/application.js.erb
guts-2.0.2 app/assets/javascripts/guts/application.js.erb
guts-2.0.1 app/assets/javascripts/guts/application.js.erb
guts-2.0.0 app/assets/javascripts/guts/application.js.erb