0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/admin/assets/js/blog.js

42 lines
1.3 KiB
JavaScript
Raw Normal View History

2013-05-11 17:44:25 +01:00
/*global window, history, jQuery, Showdown, CodeMirror */
(function ($) {
"use strict";
$(document).ready(function () {
// Shadow on Markdown if scrolled
$('.content-list-content').on('scroll', function (e) {
if ($('.content-list-content').scrollTop() > 10) {
$('.content-list').addClass('scrolling');
} else {
$('.content-list').removeClass('scrolling');
}
});
// Shadow on Preview if scrolled
$('.content-preview-content').on('scroll', function (e) {
if ($('.content-preview-content').scrollTop() > 10) {
$('.content-preview').addClass('scrolling');
} else {
$('.content-preview').removeClass('scrolling');
}
});
$('.post-controls .delete').on('click', function (e) {
e.preventDefault();
var postID = $('.content-list-content').find('li.active').data('id');
$.ajax({
method: 'DELETE',
url: '/api/v0.1/posts/' + postID,
success: function (res) {
window.location.reload();
},
error: function () {
window.alert('Delete failed.');
}
});
});
2013-05-11 17:44:25 +01:00
});
}(jQuery));