Browse Source

dashboard : fixes

idleman 1 year ago
parent
commit
3fd4651a7d
1 changed files with 14 additions and 13 deletions
  1. 14 13
      plugin/dashboard/js/component.js

+ 14 - 13
plugin/dashboard/js/component.js

@@ -25,19 +25,7 @@ function init_components_dashboard(input){
 			lineNumber : data.line
 		});
 		input.data('component',component);
-	}
-
-	if(data.scope){
-		$.action({
-			action: 'dashboard_widget_search',
-			scope: data.scope,
-			uid: data.uid
-		},function(response){
-			component.addWidgets(response.widgets);
-		});
-	}
-
-	if(data.onRefresh){
+		if(data.onRefresh){
 		setInterval(function(){
 			$.action({
 				action : data.onRefresh,
@@ -53,8 +41,21 @@ function init_components_dashboard(input){
 			});
 
 		},1000);
+		}
 	}
 
+	if(data.scope){
+		$.action({
+			action: 'dashboard_widget_search',
+			scope: data.scope,
+			uid: data.uid
+		},function(response){
+			component.addWidgets(response.widgets);
+		});
+	}
+
+	
+
 	/*component.addWidgets([{
 		width : 1,
 		height: 1,