diff --git a/include/staff/footer.inc.php b/include/staff/footer.inc.php index 2c0c45eb0d6b76c73317d26612dde1371ea68e63..5abc0997369e1e00e9e3d79bc98ae92b671438ca 100644 --- a/include/staff/footer.inc.php +++ b/include/staff/footer.inc.php @@ -19,7 +19,7 @@ if(is_object($thisstaff) && $thisstaff->isStaff()) { ?> <i class="icon-spinner icon-spin icon-3x pull-left icon-light"></i> <h1><?php echo __('Loading ...');?></h1> </div> -<div class="dialog draggable" style="display:none;width:650px;" id="popup"> +<div class="dialog draggable" style="display:none;" id="popup"> <div id="popup-loading"> <h1 style="margin-bottom: 20px;"><i class="icon-spinner icon-spin icon-large"></i> <?php echo __('Loading ...');?></h1> diff --git a/scp/css/scp.css b/scp/css/scp.css index 917746f3bbe4f6705e68d13918742e16130128f4..e797c6083c7d134b349d94b230960d02ade136d2 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1377,6 +1377,18 @@ time { overflow-y: auto; } +.dialog#popup { + width:650px; +} + +.dialog.size-normal { + width:650px !important; +} + +.dialog.size-large { + width:750px !important; +} + .dialog #popup-loading { position:absolute; text-align:center; diff --git a/scp/js/scp.js b/scp/js/scp.js index 19f85f34a289927aa9fb85e0ad480d24abbfd6e5..c84b07b29102078bf83d1312151bff0be4183812 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -321,7 +321,7 @@ var scp_prep = function() { }); //Dialog - $('.dialog').each(function() { + $('.dialog').resize(function() { var w = $(window), $this=$(this); $this.css({ top : (w.innerHeight() / 7), @@ -330,9 +330,18 @@ var scp_prep = function() { $this.hasClass('draggable') && $this.draggable({handle:'h3'}); }); + + $('.dialog').each(function() { + $this=$(this); + $this.resize(); + $this.hasClass('draggable') && $this.draggable({handle:'h3'}); + }); + $('.dialog').delegate('input.close, a.close', 'click', function(e) { e.preventDefault(); - $(this).parents('div.dialog').hide() + $(this).parents('div.dialog') + .hide() + .removeAttr('style'); $.toggleOverlay(false); return false; @@ -542,11 +551,18 @@ $.dialog = function (url, codes, cb, options) { var $popup = $('.dialog#popup'); + $popup.attr('class', + function(pos, classes) { + return classes.replace(/\bsize-\S+/g, ''); + }); + + $popup.addClass(options.size ? ('size-'+options.size) : 'size-normal'); + $.toggleOverlay(true); $('div.body', $popup).empty().hide(); $('div#popup-loading', $popup).show() .find('h1').css({'margin-top':function() { return $popup.height()/3-$(this).height()/3}}); - $popup.show(); + $popup.resize().show(); $('div.body', $popup).load(url, function () { $('div#popup-loading', $popup).hide(); $('div.body', $popup).slideDown({ diff --git a/scp/js/ticket.js b/scp/js/ticket.js index 729529c4fe03725f8a9c46c2eee40c94001abe1f..600d8186bf7b0e63824daf67b9fdbe174807aacf 100644 --- a/scp/js/ticket.js +++ b/scp/js/ticket.js @@ -339,9 +339,10 @@ var ticket_onload = function($) { +$(this).attr('href').substr(1) +'?_uid='+new Date().getTime(); var $redirect = $(this).data('href'); + var $options = $(this).data('dialog'); $.dialog(url, [201], function (xhr) { window.location.href = $redirect ? $redirect : window.location.href; - }); + }, $options); return false; });