Переглянути джерело

Dashboard : correctifs ui + set model examples & test selection type

idleman 2 роки тому
батько
коміт
d2b3568cde

+ 2 - 2
plugin/dashboard/DashboardWidget.class.php

@@ -94,7 +94,7 @@ class DashboardWidget extends Entity{
 		$clock->content = '<div class="text-center m-auto">13:37</div>';
 		$clock->width = 3;
 		$clock->height = 3;
-		$clock->uid = 'clock';
+		$clock->model = 'clock';
 		$models['clock'] = $clock;
 
 
@@ -106,7 +106,7 @@ class DashboardWidget extends Entity{
 		$newModel->content = '<small class="text-center m-auto text-muted">Veuillez configurer votre widget</small>';
 		$newModel->width = 3;
 		$newModel->height = 2;
-		$newModel->uid = self::MODEL_NEW;
+		$newModel->model = self::MODEL_NEW;
 		$models[self::MODEL_NEW] = $newModel;
 
 		foreach($models as $model){

+ 2 - 0
plugin/dashboard/css/component.css

@@ -122,6 +122,8 @@
 	background-color: #222222;
 	color: #ffffff;
 	border-radius: 10px 10px 0 0;
+	    max-height: 35px;
+	    overflow: hidden;
 	display: flex;
 }
 .dashboard-container .dashboard-widget .dashboard-widget-content{

+ 17 - 11
plugin/dashboard/js/component.js

@@ -107,17 +107,23 @@ function init_components_dashboard(input){
 		        id : id,
 		        menu : menu
 		    },function(response){
-		    	$('#widget-types li').click(function(){
-		    		$('#widget-types li').removeClass('active');
-		    		$(this).addClass('active');
-		    		$.action({
-				        action : data.onSelectModel,
-				        id : id,
-				        model : $(this).attr('data-model')
-				    },function(response){
-
-				    });
-		    	});
+
+		    	switch(menu){
+		    		case 'type':
+		    		
+		    		$('#widget-types li').click(function(){
+			    		$('#widget-types li').removeClass('active');
+			    		$(this).addClass('active');
+			    		$.action({
+					        action : data.onSelectModel,
+					        id : id,
+					        model : $(this).attr('data-model')
+					    },function(response){
+
+					    });
+			    	});
+		    		break;
+		    	}
 		    });
 		}