Better loading graphic position in preview pane
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 16 Apr 2009 03:49:50 +0000 (21:49 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 16 Apr 2009 05:10:30 +0000 (23:10 -0600)
imp/js/src/DimpBase.js

index 202c3ec..0bc7eb0 100644 (file)
@@ -898,8 +898,8 @@ var DimpBase = {
 
     loadPreview: function(data, params)
     {
-        var pp = $('previewPane'), pp_offset, pp_uid;
-        if (!pp.visible()) {
+        var offset, pp_uid;
+        if (!$('previewPane').visible()) {
             return;
         }
 
@@ -923,8 +923,10 @@ var DimpBase = {
             }
         }
 
-        pp_offset = pp.positionedOffset();
-        $('msgLoading').setStyle({ position: 'absolute', top: (pp_offset.top + 10) + 'px', left: (pp_offset.left + 10) + 'px' }).show();
+        offset = $('previewMsg').visible()
+            ? $('msgBody').positionedOffset()
+            : $('previewPane').positionedOffset();
+        $('msgLoading').setStyle({ position: 'absolute', top: (offset.top + 10) + 'px', left: (offset.left + 10) + 'px' }).show();
 
         DimpCore.doAction('ShowPreview', params || {}, this.viewport.createSelection('dataob', this.pp), this.bcache.get('loadPC') || this.bcache.set('loadPC', this._loadPreviewCallback.bind(this)));
     },