mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Save now closes edit mode. (#52).
This commit is contained in:
parent
250e354659
commit
224d2f92c3
@ -72,6 +72,12 @@ function (angular, $, config, _) {
|
|||||||
$rootScope.fullscreen = false;
|
$rootScope.fullscreen = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$rootScope.$on('dashboard-saved', function() {
|
||||||
|
if ($rootScope.fullscreen) {
|
||||||
|
$rootScope.$emit('panel-fullscreen-exit');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
keyboardManager.bind('ctrl+f', function(evt) {
|
keyboardManager.bind('ctrl+f', function(evt) {
|
||||||
$rootScope.$emit('open-search', evt);
|
$rootScope.$emit('open-search', evt);
|
||||||
}, { inputDisabled: true });
|
}, { inputDisabled: true });
|
||||||
|
@ -65,17 +65,18 @@ function (angular, _, moment) {
|
|||||||
type,
|
type,
|
||||||
($scope.elasticsearch.title || dashboard.current.title),
|
($scope.elasticsearch.title || dashboard.current.title),
|
||||||
($scope.loader.save_temp_ttl_enable ? ttl : false)
|
($scope.loader.save_temp_ttl_enable ? ttl : false)
|
||||||
).then(
|
).then(function(result) {
|
||||||
function(result) {
|
if(_.isUndefined(result._id)) {
|
||||||
if(!_.isUndefined(result._id)) {
|
|
||||||
alertSrv.set('Dashboard Saved','This dashboard has been saved to Elasticsearch as "' +
|
|
||||||
result._id + '"','success',5000);
|
|
||||||
if(type === 'temp') {
|
|
||||||
$scope.share = dashboard.share_link(dashboard.current.title,'temp',result._id);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
alertSrv.set('Save failed','Dashboard could not be saved to Elasticsearch','error',5000);
|
alertSrv.set('Save failed','Dashboard could not be saved to Elasticsearch','error',5000);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alertSrv.set('Dashboard Saved', 'This dashboard has been saved to Elasticsearch as "' + result._id + '"','success', 5000);
|
||||||
|
if(type === 'temp') {
|
||||||
|
$scope.share = dashboard.share_link(dashboard.current.title,'temp',result._id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$rootScope.$emit('dashboard-saved');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,9 +56,9 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
|
|||||||
],
|
],
|
||||||
|
|
||||||
menuItems: [
|
menuItems: [
|
||||||
{ text: 'View fullscreen', click: 'toggleFullscreen()' },
|
{ text: 'Edit', click: 'openConfigureModal()' },
|
||||||
{ text: 'Edit', click: 'openConfigureModal()' },
|
{ text: 'Fullscreen', click: 'toggleFullscreen()' },
|
||||||
{ text: 'Duplicate', click: 'duplicate()' },
|
{ text: 'Duplicate', click: 'duplicate()' },
|
||||||
{ text: 'Span', submenu: [
|
{ text: 'Span', submenu: [
|
||||||
{ text: '1', click: 'updateColumnSpan(1)' },
|
{ text: '1', click: 'updateColumnSpan(1)' },
|
||||||
{ text: '2', click: 'updateColumnSpan(2)' },
|
{ text: '2', click: 'updateColumnSpan(2)' },
|
||||||
|
@ -71,9 +71,7 @@
|
|||||||
<select class="input-small" ng-model="panel.tooltip.value_type" ng-options="f for f in ['cumulative','individual']" ng-change="render()"></select>
|
<select class="input-small" ng-model="panel.tooltip.value_type" ng-options="f for f in ['cumulative','individual']" ng-change="render()"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="editor-row">
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<h5>Legend<h5>
|
<h5>Legend<h5>
|
||||||
<div class="editor-option">
|
<div class="editor-option">
|
||||||
|
Loading…
Reference in New Issue
Block a user