updates and remove main.css

This commit is contained in:
Henrique Dias
2015-09-18 19:12:47 +01:00
parent 0549bd73eb
commit a569ccc32a
10 changed files with 216 additions and 3489 deletions

View File

@@ -3,9 +3,9 @@ $(document).ready(function() {
});
$(document).on('ready pjax:success', function() {
$('textarea.auto-size').textareaAutoSize();
// Starts the perfect scroolbar plugin
$('.scroll').perfectScrollbar();
$('textarea.auto-size').textareaAutoSize();
// Toggles between preview and editing mode
$("#preview").click(function(event) {
@@ -48,17 +48,17 @@ $(document).on('ready pjax:success', function() {
event.preventDefault();
var data = JSON.stringify($(this).serializeJSON()),
url = $(this).attr('action'),
button = $(this).find("input[type=submit]:focus");
console.log(data)
$.ajax({
type: 'POST',
url: url,
url: window.location,
data: data,
headers: {
'X-Regenerate': button.data("regenerate")
'X-Regenerate': button.data("regenerate"),
'X-Content-Type': button.data("type")
},
dataType: 'json',
encode: true,
@@ -104,4 +104,11 @@ $(document).on('ready pjax:success', function() {
fieldset.append("<input name=\"" + fieldset.attr("name") + "\" id=\"" + fieldset.attr("name") + "\" value=\"\"></input><br>");
return false;
});
});
});
$(document).on('pjax:send', function() {
$('#loading').fadeIn()
})
$(document).on('pjax:complete', function() {
$('#loading').fadeOut()
})