Skip to content

Instantly share code, notes, and snippets.

@jerome-diver
Created September 10, 2016 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerome-diver/6dcd88a0f7d582fa604c6c632ad7fb3d to your computer and use it in GitHub Desktop.
Save jerome-diver/6dcd88a0f7d582fa604c6c632ad7fb3d to your computer and use it in GitHub Desktop.
editor text_area appear on the first call, then no more instead of reload the page. turboloink has been disabled
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery2
//= require jquery_ujs
//= require tinymce
//= require jquery-ui
//= require jquery.remotipart
//= require bootstrap
//= require jstree
//= require blueimp/blueimp-gallery
//= require blueimp/jquery.blueimp-gallery
//= require cocoon
//= require the_comments
//= require prism
$(document).on('turbolinks:load page:update ready', function() {
$('form[data-remote]').bind('ajax:before', function() {
console.log("AJAX:BEFORE bind!"); });
return $("#tabs").tabs();
});
$(document).on('click', '.edit', function(){
console.log("YOOOOOOP"); });
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$(".preview").attr('src',e.target.result)
.width(140)
.height(140);
};
reader.readAsDataURL(input.files[0]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment