|
@@ -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',
|