[dashboard] The non-Gridster dashboards shouldn't throw a JS error on page resize
@@ -4276,9 +4276,11 @@ $(document).ready(function () {
var widgetGridWidth = null;
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);
}
+ }
setWidgetGridWidth();
huePubSub.subscribe('dashboard.window.resize', setWidgetGridWidth, 'dashboard');
