Code style and performance fixes

This commit is contained in:
NGPixel
2016-10-17 19:52:04 -04:00
parent 847c81946a
commit 9454065ab9
12 changed files with 57 additions and 54 deletions

View File

@@ -10,7 +10,7 @@ if($('#mk-editor').length === 1) {
Vue.filter('filesize', (v) => {
return _.toUpper(filesize(v));
})
});
//=include editor-image.js
//=include editor-codeblock.js
@@ -170,26 +170,26 @@ if($('#mk-editor').length === 1) {
}
});
}
//-> Save
//-> Save
$('.btn-edit-save, .btn-create-save').on('click', (ev) => {
$('.btn-edit-save, .btn-create-save').on('click', (ev) => {
$.ajax(window.location.href, {
data: {
markdown: mde.value()
},
dataType: 'json',
method: 'PUT'
}).then((rData, rStatus, rXHR) => {
if(rData.ok) {
window.location.assign('/' + pageEntryPath);
} else {
alerts.pushError('Something went wrong', rData.error);
}
}, (rXHR, rStatus, err) => {
alerts.pushError('Something went wrong', 'Save operation failed.');
});
$.ajax(window.location.href, {
data: {
markdown: mde.value()
},
dataType: 'json',
method: 'PUT'
}).then((rData, rStatus, rXHR) => {
if(rData.ok) {
window.location.assign('/' + pageEntryPath);
} else {
alerts.pushError('Something went wrong', rData.error);
}
}, (rXHR, rStatus, err) => {
alerts.pushError('Something went wrong', 'Save operation failed.');
});
});
}