diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js index d93a9ee679cb707432559c472e0ee5bbc2360d02..a0225e94099f7c6bf0728e95f7ac8565fe159986 100644 --- a/js/redactor-osticket.js +++ b/js/redactor-osticket.js @@ -280,8 +280,13 @@ $(function() { // Make a rich text editor immediately redact(el); }); + }, + cleanupRedactorElements = function() { + // Drop the added redactor_air bars + $('.redactor_air').remove(); }; findRichtextBoxes(); $(document).ajaxStop(findRichtextBoxes); $(document).on('pjax:success', findRichtextBoxes); + $(document).on('pjax:start', cleanupRedactorElements); }); diff --git a/scp/js/scp.js b/scp/js/scp.js index 02cc813c4aa0dd53b75954fa2066fa209a391754..a1de92d4191b6f5f88366a8b0e3af61d3063afb2 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -140,7 +140,10 @@ var scp_prep = function() { $('input[type=submit]', fObj).css('color', 'red'); $(window).bind('beforeunload', function(e) { return 'Are you sure you want to leave? Any changes or info you\'ve entered will be discarded!'; - }); + }); + $(document).on('pjax:beforeSend.changed', function(e) { + return confirm('Are you sure you want to leave? Any changes or info you\'ve entered will be discarded!'); + }); } }; @@ -639,10 +642,6 @@ $(document).on('pjax:start', function() { window.clearTimeout(id); } - // Close popups - // Close tooltips - $('.dialog, .tip_box').empty().hide(); - if ($("#loadingbar").length === 0) { $("body").append("<div id='loadingbar'></div>"); $("#loadingbar").addClass("waiting").append($("<dt/><dd/>")); @@ -651,6 +650,10 @@ $(document).on('pjax:start', function() { $("#loadingbar").width((50 + Math.random() * 30) + "%"); $('#overlay').css('background-color','white').fadeIn(); } + + // Cancel save-changes warning banner + $(document).unbind('pjax:beforeSend.changed'); + $(window).unbind('beforeunload'); }); $(document).on('pjax:end', function() { // right @@ -658,13 +661,11 @@ $(document).on('pjax:end', function() { $(this).remove(); }); $('#overlay').hide().removeAttr('style'); -}); -$(document).on('click', 'a', function() { - var ul = $(this).closest('ul'); - if (ul.is('#sub_nav')) { - $('a.active', ul).removeClass('active'); - $(this).addClass('active'); - } + + // Close popups + // Close tooltips + $('.tip_box').empty().hide(); + $('.dialog .body').empty().parent().hide(); }); // Quick note interface diff --git a/scp/tickets.php b/scp/tickets.php index 48bcdb00324df321b03547edf2f1ef91219047ad..dcc41fbc2923f7f0ff9a1b5aa260763205d2808c 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -622,7 +622,7 @@ if($ticket) { } $ost->addExtraHeader('<script type="text/javascript" src="js/ticket.js"></script>'); -$ost->addExtraHeader('<meta name="tip-namespace" content="tickets.open" />', +$ost->addExtraHeader('<meta name="tip-namespace" content="tickets.queue" />', "$('#content').data('tipNamespace', 'tickets.queue');"); require_once(STAFFINC_DIR.'header.inc.php');