Commit 155cce95 by Torkel Ödegaard

more polish on edit mode

parent e215ba82
...@@ -40,7 +40,6 @@ export class DashboardCtrl { ...@@ -40,7 +40,6 @@ export class DashboardCtrl {
$scope.setupDashboardInternal = function(data) { $scope.setupDashboardInternal = function(data) {
var dashboard = dashboardSrv.create(data.dashboard, data.meta); var dashboard = dashboardSrv.create(data.dashboard, data.meta);
dashboardSrv.setCurrent(dashboard); dashboardSrv.setCurrent(dashboard);
dashboard.editMode = true;
// init services // init services
timeSrv.init(dashboard); timeSrv.init(dashboard);
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<li ng-if="::showSettingsMenu" class="dropdown"> <li ng-if="::showSettingsMenu" class="dropdown">
<a class="pointer" ng-click="hideTooltip($event)" bs-tooltip="'Manage dashboard'" data-placement="bottom" data-toggle="dropdown"><i class="fa fa-cog"></i></a> <a class="pointer" ng-click="hideTooltip($event)" bs-tooltip="'Manage dashboard'" data-placement="bottom" data-toggle="dropdown"><i class="fa fa-cog"></i></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="dashboard.editMode = true;">Enter Build Mode</a></li> <li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="dashboard.toggleEditMode();">Enter Build Mode</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('settings');">Settings</a></li> <li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('settings');">Settings</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('annotations');">Annotations</a></li> <li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('annotations');">Annotations</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('templating');">Templating</a></li> <li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('templating');">Templating</a></li>
......
...@@ -65,6 +65,10 @@ export class DashboardModel { ...@@ -65,6 +65,10 @@ 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);
} }
......
...@@ -48,9 +48,9 @@ export class AddPanelCtrl { ...@@ -48,9 +48,9 @@ export class AddPanelCtrl {
} }
panelSearchBlur() { panelSearchBlur() {
this.$timeout(() => { // this.$timeout(() => {
this.rowCtrl.dropView = 0; // this.rowCtrl.dropView = 0;
}, 400); // }, 400);
} }
moveSelection(direction) { moveSelection(direction) {
......
<div class="dash-row-header"> <div class="dash-row-header" ng-if="ctrl.dashboard.editMode || ctrl.row.showTitle">
<a class="dash-row-header-title" ng-click="ctrl.toggleCollapse()"> <a class="dash-row-header-title" ng-click="ctrl.toggleCollapse()">
<span class="dash-row-collapse-toggle pointer"> <span class="dash-row-collapse-toggle pointer">
<i class="fa fa-chevron-down" ng-show="!ctrl.row.collapse"></i> <i class="fa fa-chevron-down" ng-show="!ctrl.row.collapse"></i>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</div> </div>
<div class="gf-form" ng-if="ctrl.dashboard.editMode" ng-click="ctrl.exitBuildMode();"> <div class="gf-form" ng-if="ctrl.dashboard.editMode" ng-click="ctrl.exitBuildMode();">
<button class="btn btn-primary gf-form-btn"> <button class="btn btn-secondary gf-form-btn">
Exit Build Mode Exit Build Mode
</button> </button>
</div> </div>
......
...@@ -206,7 +206,6 @@ div.flot-text { ...@@ -206,7 +206,6 @@ div.flot-text {
// //
.dash-row { .dash-row {
border-left: 1px solid $dark-4;
display: block; display: block;
} }
...@@ -216,7 +215,6 @@ div.flot-text { ...@@ -216,7 +215,6 @@ div.flot-text {
flex-direction: row; flex-direction: row;
margin-right: $panel-margin; margin-right: $panel-margin;
margin-left: 0; margin-left: 0;
// border-bottom: 1px solid $dark-4;
&:hover { &:hover {
.dash-row-header-actions { .dash-row-header-actions {
...@@ -224,16 +222,15 @@ div.flot-text { ...@@ -224,16 +222,15 @@ div.flot-text {
} }
} }
.h1 { font-size: $font-size-h1; } .h1 { font-size: 3rem; font-style: normal; }
.h2 { font-size: $font-size-h2; } .h2 { font-size: 2.5rem; }
.h3 { font-size: $font-size-h3; } .h3 { font-size: 2rem; }
.h4 { font-size: $font-size-h4; } .h4 { font-size: 1.7rem; }
.h5 { font-size: $font-size-h5; } .h5 { font-size: 1.4rem; }
.h6 { font-size: $font-size-h6; } .h6 { font-size: 1rem }
} }
.dash-row-header-title { .dash-row-header-title {
border-top: 1px solid $dark-4;
padding: 0.6rem; padding: 0.6rem;
.dash-row-collapse-toggle { .dash-row-collapse-toggle {
...@@ -285,8 +282,13 @@ div.flot-text { ...@@ -285,8 +282,13 @@ div.flot-text {
.dash-edit-mode { .dash-edit-mode {
.dash-row { .dash-row {
border-left: 1px solid $dark-4;
}
.dash-row-header-title {
border-top: 1px solid $dark-4;
} }
.panels-wrapper { .panels-wrapper {
margin-left: $panel-margin;
} }
} }
...@@ -309,13 +311,13 @@ div.flot-text { ...@@ -309,13 +311,13 @@ div.flot-text {
.dash-row-options { .dash-row-options {
background: $panel-bg; background: $panel-bg;
border: $panel-border; border: $panel-border;
margin: 0 0 $panel-margin*2 $panel-margin; margin: 0 0 $panel-margin*2 $panel-margin*2;
padding: $spacer*1.5; padding: $spacer*1.5;
} }
.dash-row-add-panel { .dash-row-add-panel {
margin: 0; margin: 0;
padding: $panel-margin; padding: $panel-margin*2;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
position: relative; position: relative;
...@@ -325,6 +327,7 @@ div.flot-text { ...@@ -325,6 +327,7 @@ div.flot-text {
position: absolute; position: absolute;
width: 200px; width: 200px;
top: -34px; top: -34px;
left: 5px;
} }
.add-panel-panels-scroll { .add-panel-panels-scroll {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment