This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
blarg/resources/public/js/modals.js

44 lines
1.4 KiB
JavaScript
Raw Normal View History

2013-05-20 17:43:38 -04:00
$(document).ready(function() {
////////////////////////////////////////////////////////////////////////////
// Publish Post Modal
$('a[data-publishpostid]').click(function() {
var postId = $(this).data('publishpostid');
$('#publishModalOkNoReset').data('forpostid', postId);
$('#publishModalOk').data('forpostid', postId);
$('#publishModal').modal({backdrop: 'static', keyboard: false});
});
$('#publishModalOkNoReset').click(function() {
var postId = $(this).data('forpostid');
$('#publishModal').find('button').attr('disabled', 'disabled');
window.location = context + "/publish/" + postId;
});
$('#publishModalOk').click(function() {
var postId = $(this).data('forpostid');
$('#publishModal').find('button').attr('disabled', 'disabled');
window.location = context + "/publish/" + postId + "?reset-date=true";
});
////////////////////////////////////////////////////////////////////////////
// Delete Post Modal
$('a[data-deletepostid]').click(function() {
var postId = $(this).data('deletepostid');
$('#deleteModalOk').data('forpostid', postId);
$('#deleteModal').modal({backdrop: 'static', keyboard: false});
});
$('#deleteModalOk').click(function() {
var postId = $(this).data('forpostid');
$('#deleteModal').find('button').attr('disabled', 'disabled');
window.location = context + "/deletepost/" + postId;
});
////////////////////////////////////////////////////////////////////////////
})