-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathProcessBlog.js
More file actions
56 lines (44 loc) · 2.03 KB
/
ProcessBlog.js
File metadata and controls
56 lines (44 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
*
* Javascript file for PW Module ProcessBlog
*
* @author Francis Otieno (Kongondo) <[email protected]>
*
* https://github.com/kongondo/Blog
* Created February 2014
*
*/
$(document).ready(function(){
$('.editBlog').on('pw-modal-closed', function(evt, ui) {
window.location.reload(true);// force parent page refresh on modal close [note: adapted for magnific popup]
});
/** Fix for MarkupAdminDataTable: Don't enable sorting on first column with input checkbox **/
//if ($.tablesorter != undefined) $.tablesorter.defaults.headers = {0:{sorter:false}};
// if we are NOT on the widgets or authors tables, then disable sorting on first column
if (!$('table').hasClass('noDisable')) {
if ($.tablesorter != undefined) $.tablesorter.defaults.headers = {0:{sorter:false}};// works but requires two clicks to kick-in!
}
// submit form on select of limit of items to show - posts, categories, tags
/*$('#limit').change(function () {
$(this).closest('form').submit();
});
//broken in PW dev 2.5.7. See issue #784 on GitHub
*/
$('select#limit, select#items_sort_select').change(function(){ $(this).closest("form").removeClass("nosubmit").submit(); });// note workaround for PW issue #784 (GitHub)
});
/** Toggle all checkboxes in th for 'posts', 'categories' and 'tags' tables **/
$(document).on('change', 'input.toggle_all', function() {
if ($(this).prop('checked')) $('input.toggle').prop('checked', true);
else $('input.toggle').prop('checked', false);
});
$(document).on('click', 'button#quickpost_save_and_exit_btn, button#categories_add_and_exit_btn, button#tags_add_and_exit_btn', function() {
closeDialog(350);// close this jquery UI dialog after 350 millisecond delay from within the parent window
});
// close jquery UI dialog
closeDialog = function(s=1000) {
setTimeout(function() {
//parent.jQuery('div.ui-dialog-titlebar button.ui-dialog-titlebar-close').click();
parent.jQuery('iframe.ui-dialog-content').dialog('close');
//parent.document.location.reload(true);
}, s);
}