Browse Source

[assist] Fixes for rendering of an initially closed left panel

Enrico Berti 9 years ago
parent
commit
dda1512b5d

+ 4 - 1
desktop/core/src/desktop/static/desktop/js/assist/assistHelper.js

@@ -104,8 +104,11 @@
     }
 
     observable.subscribe(function (newValue) {
+      if (owner === 'assist' && id === 'assist_panel_visible') {
+        huePubSub.publish('assist.forceRender');
+      }
       self.setInTotalStorage(owner, id, newValue);
-    })
+    });
   };
 
   /**

+ 7 - 3
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -1086,6 +1086,9 @@
         }
         window.setTimeout(adjustHeightSingle, 200);
         $(window).resize(adjustHeightSingle);
+        huePubSub.subscribe('assist.forceRender', function () {
+          window.setTimeout(adjustHeightSingle, 200);
+        });
         $allExtras.show();
         $allPanels.show();
         return;
@@ -1160,8 +1163,9 @@
 
       resizeByRatio();
       $(window).resize(resizeByRatio);
-
-      huePubSub.subscribe('assist.forceResize', resizeByRatio);
+      huePubSub.subscribe('assist.forceRender', function () {
+        window.setTimeout(resizeByRatio, 200);
+      });
 
       $allExtras.show();
       $allPanels.show();
@@ -2895,7 +2899,7 @@
           if (wrappable.is('table') && startItem % 2 == 1) {
             startItem--;
           }
-          endItem = Math.min(startItem + Math.ceil($parent.parents(scrollable).height() / itemHeight) + 10, data.length);
+          endItem = Math.min(startItem + Math.ceil($parent.parents(scrollable).height() / itemHeight) + 20, data.length);
           wrappable.css('top', ((startItem * itemHeight) + fluidCorrection) + 'px');
         }
         else {