From a0cf7a4aadd19f8eccc0266b7bd3db4d450a5958 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Tue, 5 Aug 2014 08:57:53 -0500
Subject: [PATCH] Fix positioning of loading dialog overlay

---
 include/staff/dynamic-form.inc.php | 14 +++++++++-----
 include/staff/dynamic-list.inc.php | 15 ++++++++++-----
 scp/css/scp.css                    | 12 ++++++++++++
 setup/cli/modules/i18n.php         |  2 +-
 4 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/include/staff/dynamic-form.inc.php b/include/staff/dynamic-form.inc.php
index 79ef67f63..0f18c7e89 100644
--- a/include/staff/dynamic-form.inc.php
+++ b/include/staff/dynamic-form.inc.php
@@ -272,7 +272,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
 
 <div style="display:none;" class="dialog draggable" id="field-config">
     <div id="popup-loading">
-        <h1><i class="icon-spinner icon-spin icon-large pull-left"></i>
+        <h1><i class="icon-spinner icon-spin icon-large"></i>
         <?php echo __('Loading ...');?></h1>
     </div>
     <div class="body"></div>
@@ -280,10 +280,14 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
 
 <script type="text/javascript">
 $(function() {
-    $('#popup-loading').hide().ajaxStart( function() {
-        $(this).show();  // show Loading Div
-    } ).ajaxStop ( function(){
-        $(this).hide(); // hide loading div
+    var $this = $('#popup-loading').hide();
+    $(document).ajaxStart( function(event) {
+        console.log(1,event);
+        var $h1 = $this.find('h1');
+        $this.show();
+        $h1.css({'margin-top':$this.height()/3-$h1.height()/3});  // show Loading Div
+    }).ajaxStop ( function(){
+        $this.hide(); // hide loading div
     });
 });
 $('form.manage-form').on('submit.inline', function(e) {
diff --git a/include/staff/dynamic-list.inc.php b/include/staff/dynamic-list.inc.php
index 38629cf73..d4126e821 100644
--- a/include/staff/dynamic-list.inc.php
+++ b/include/staff/dynamic-list.inc.php
@@ -268,17 +268,22 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
 
 <div style="display:none;" class="dialog draggable" id="field-config">
     <div id="popup-loading">
-        <h1><i class="icon-spinner icon-spin icon-large pull-left"></i>
+        <h1><i class="icon-spinner icon-spin icon-large"></i>
         <?php echo __('Loading ...');?></h1>
     </div>
     <div class="body"></div>
 </div>
+
 <script type="text/javascript">
 $(function() {
-    $('#popup-loading').hide().ajaxStart( function() {
-        $(this).show();  // show Loading Div
-    } ).ajaxStop ( function(){
-        $(this).hide(); // hide loading div
+    var $this = $('#popup-loading').hide();
+    $(document).ajaxStart( function(event) {
+        console.log(1,event);
+        var $h1 = $this.find('h1');
+        $this.show();
+        $h1.css({'margin-top':$this.height()/3-$h1.height()/3});  // show Loading Div
+    }).ajaxStop ( function(){
+        $this.hide(); // hide loading div
     });
 });
 </script>
diff --git a/scp/css/scp.css b/scp/css/scp.css
index 11a647993..f52ab06aa 100644
--- a/scp/css/scp.css
+++ b/scp/css/scp.css
@@ -1336,9 +1336,21 @@ time {
     box-shadow: 0 5px 60px #001;
     border-radius: 5px;
     max-height: 72%;
+    min-height: 50px;
     overflow-y: auto;
 }
 
+.dialog .popup-loading {
+    position:absolute;
+    text-align:center;
+    background:rgba(255,255,255,0.8);
+    top:0;
+    bottom:0;
+    left:0;
+    right:0;
+    z-index:1;
+}
+
 .redactor_editor {
     font-size: 11pt;
 }
diff --git a/setup/cli/modules/i18n.php b/setup/cli/modules/i18n.php
index c9152ac62..8edb5c955 100644
--- a/setup/cli/modules/i18n.php
+++ b/setup/cli/modules/i18n.php
@@ -245,7 +245,7 @@ class i18n_Compiler extends Module {
             #'Approved' =>
             'Id' => 'lang:' . $lang,
             'Last-Revision' => $po_header['PO-Revision-Date'],
-            'Version' => strtotime($po_header['PO-Revision-Date']) / 10000,
+            'Version' => (int)(strtotime($po_header['PO-Revision-Date']) / 10000),
         );
         $phar->addFromString(
             'MANIFEST.php',
-- 
GitLab