Browse Source

ux(dashboard): minor fixes

Torkel Ödegaard 9 years ago
parent
commit
3fc6f6d730

+ 2 - 2
public/app/core/routes/dashboard_loaders.js

@@ -28,15 +28,15 @@ function (coreModule) {
 
 
   coreModule.default.controller('NewDashboardCtrl', function($scope) {
   coreModule.default.controller('NewDashboardCtrl', function($scope) {
     $scope.initDashboard({
     $scope.initDashboard({
-      meta: { canStar: false, canShare: false },
+      meta: { canStar: false, canShare: false, isNew: true },
       dashboard: {
       dashboard: {
         title: "New dashboard",
         title: "New dashboard",
+        isNew: true,
         rows: [
         rows: [
           {
           {
             title: 'Dashboard Row',
             title: 'Dashboard Row',
             height: '250px',
             height: '250px',
             panels:[],
             panels:[],
-            isNew: true,
           }
           }
         ]
         ]
       },
       },

+ 3 - 4
public/app/features/dashboard/model.ts

@@ -65,15 +65,14 @@ export class DashboardModel {
     this.links = data.links || [];
     this.links = data.links || [];
     this.gnetId = data.gnetId || null;
     this.gnetId = data.gnetId || null;
 
 
-    if (this.id === null) {
-      this.editMode = true;
-    }
-
     this.updateSchema(data);
     this.updateSchema(data);
     this.initMeta(meta);
     this.initMeta(meta);
+
+    this.editMode = this.meta.isNew;
   }
   }
 
 
   private initMeta(meta) {
   private initMeta(meta) {
+    console.log(meta);
     meta = meta || {};
     meta = meta || {};
 
 
     meta.canShare = meta.canShare !== false;
     meta.canShare = meta.canShare !== false;

+ 1 - 1
public/app/features/dashboard/row/row.ts

@@ -19,7 +19,7 @@ export class DashRowCtrl {
   constructor(private $scope, private $rootScope, private $timeout, private uiSegmentSrv, private $q) {
   constructor(private $scope, private $rootScope, private $timeout, private uiSegmentSrv, private $q) {
     this.row.title = this.row.title || 'Row title';
     this.row.title = this.row.title || 'Row title';
 
 
-    if (this.row.isNew) {
+    if (this.dashboard.meta.isNew) {
       this.dropView = 1;
       this.dropView = 1;
       delete this.row.isNew;
       delete this.row.isNew;
     }
     }

+ 3 - 3
public/sass/pages/_dashboard.scss

@@ -353,9 +353,9 @@ div.flot-text {
 .dash-row-add-panel {
 .dash-row-add-panel {
   margin: 0;
   margin: 0;
   padding: $panel-margin*2;
   padding: $panel-margin*2;
-  display: flex;
-  align-items: flex-start;
-  position: relative;
+  // display: flex;
+  // align-items: flex-start;
+  // position: relative;
 }
 }
 
 
 .add-panel-panels-scroll {
 .add-panel-panels-scroll {