Browse Source

Dashboard : correctif du bug de reize causé par vous savez qui.... la peste soit des morreels sur 100 générations

idleman 1 year ago
parent
commit
a56852762c
1 changed files with 7 additions and 2 deletions
  1. 7 2
      plugin/dashboard/js/dashboard.js

+ 7 - 2
plugin/dashboard/js/dashboard.js

@@ -382,11 +382,16 @@ class Dashboard {
 
 	//Resize / Replace les widgets en fonction de la taille de la fenetre et des cellules de grilles
 	renderPositions(){
-		var placeholderWidth = this.placeHolders.initialWidth;
-		var placeholderHeight = this.placeHolders.initialHeight;
+		
+		var firstPlaceHolder = $('.dashboard-placeholder:eq(0)');
+		var placeholderWidth = firstPlaceHolder.width();
+		var placeholderHeight = firstPlaceHolder.height();
+		
 		for(var k in this.widgets){
 			var widget = this.widgets[k];
+		
 			var cell = $('[data-row="'+widget.row+'"][data-column="'+widget.column+'"]').position();
+			console.log($('[data-row="'+widget.row+'"][data-column="'+widget.column+'"]'),cell,placeholderWidth)
 			if(!cell) continue;
 			widget.element.css({
 				width: ((widget.width * placeholderWidth)-(this.options.placeHolderPadding*2))+'px',