소스 검색

HUE-8466 [report] Avoid Gridster JS error on swapping between dashboard modes

Enrico Berti 7 년 전
부모
커밋
a90a871b29
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako

+ 1 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -4433,7 +4433,7 @@ $(document).ready(function () {
   var setWidgetGridWidth = function () {
     if (searchViewModel && searchViewModel.isGridster()) {
       // turns out Gridster generates CSS either with single or double quotes depending on the browser
-      widgetGridWidth = typeof hueUtils.getStyleFromCSSClass('[data-sizex="1"]') !== 'undefined' ? parseInt(hueUtils.getStyleFromCSSClass('[data-sizex="1"]').width) : parseInt(hueUtils.getStyleFromCSSClass("[data-sizex='1']").width);
+      widgetGridWidth = typeof hueUtils.getStyleFromCSSClass('[data-sizex="1"]') !== 'undefined' ? parseInt(hueUtils.getStyleFromCSSClass('[data-sizex="1"]').width) : (hueUtils.getStyleFromCSSClass("[data-sizex='1']") ? parseInt(hueUtils.getStyleFromCSSClass("[data-sizex='1']").width) : null);
     }
   }