diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 78714bbd350ecec85281830bb579e6d9ce6a02c8..ff8cec8ffe7aaa67396f5db7de3247183e919196 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -148,7 +148,8 @@ if($ticket->isOverdue()) echo $ticket->getOwnerId(); ?>" onclick="javascript: $('#overlay').show(); - $('#user-info .body').load(this.href); + $('#user-info .body').load(this.href, + function() { $(this).redactify(); }); $('#user-info').show(); return false; "><i class="icon-user"></i> <?php diff --git a/js/osticket.js b/js/osticket.js index 1e8db97d4649503770a8f94f7c4f148ecb49bf99..3f38a6ec357dcd712e1823f264abd860da44507e 100644 --- a/js/osticket.js +++ b/js/osticket.js @@ -79,10 +79,11 @@ $(document).ready(function(){ }); getConfig = (function() { - var dfd = $.Deferred(); + var dfd = $.Deferred(), + requested = false; return function() { - if (dfd.state() != 'resolved') - $.ajax({ + if (dfd.state() != 'resolved' && !requested) + requested = $.ajax({ url: "ajax.php/config/client", dataType: 'json', success: function (json_config) { diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js index 0cacb986ee46b3808063fd3ff154bcf7e9b4ca42..dffb115cb719fa05615a5ccd4a15f8f886438986 100644 --- a/js/redactor-osticket.js +++ b/js/redactor-osticket.js @@ -182,8 +182,8 @@ $(function() { } el.redactor(options); }, - findRichtextBoxes = function() { - $('.richtext').each(function(i,el) { + findRichtextBoxes = function(context) { + $('.richtext', context||document).each(function(i,el) { if ($(el).hasClass('ifhtml')) // Check if html_thread is enabled first getConfig().then(function(c) { @@ -196,5 +196,8 @@ $(function() { }); }; findRichtextBoxes(); - $('#user-info').ajaxComplete(findRichtextBoxes); + $.fn.redactify = function() { + this.each(function(i,e) { findRichtextBoxes(e); }); + return this; + } }); diff --git a/scp/js/scp.js b/scp/js/scp.js index c764a4c5299b577b0f2785d5de97134dbbfb68cb..5237520609c08d396410674b54b4b499d5ff1d7a 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -469,10 +469,11 @@ $(document).ready(function(){ // NOTE: getConfig should be global getConfig = (function() { - var dfd = $.Deferred(); + var dfd = $.Deferred(), + requested = null; return function() { - if (dfd.state() != 'resolved') - $.ajax({ + if (dfd.state() != 'resolved' && !requested) + requested = $.ajax({ url: "ajax.php/config/scp", dataType: 'json', success: function (json_config) {