Commit 20b3a5d3 by Rashid Khan

Added save button to panel editors

parent 875342d3
define([
'angular',
'app',
'angular'
],
function (angular) {
'use strict';
......@@ -11,14 +10,23 @@ function (angular) {
return {
restrict: 'A',
link: function(scope, elem) {
// create a new modal. Can't reuse one modal unforunately as the directive will not
// re-render on show.
elem.bind('click',function(){
var tmpScope = scope.$new();
tmpScope.panel = angular.copy(scope.panel);
tmpScope.editSave = function(panel) {
scope.panel = panel;
};
var panelModal = $modal({
template: './app/partials/paneleditor.html',
persist: true,
show: false,
scope: scope,
scope: tmpScope,
keyboard: false
});
......
......@@ -231,14 +231,6 @@ function (angular, app, _, $, kbn) {
restrict: 'A',
link: function(scope, elem) {
scope.$on('$destroy', function() {
console.log('destroy');
if($tooltip) {
console.log('destroyed tooltip');
$tooltip.remove();
}
});
// Receive render events
scope.$on('render',function(){
render_panel();
......
......@@ -19,5 +19,6 @@
<div class="modal-footer">
<!-- close_edit() is provided here to allow for a scope to perform action on dismiss -->
<button type="button" class="btn btn-danger" ng-click="editor.index=0;close_edit();dismiss()">Close</button>
<button type="button" class="btn btn-success" ng-click="editor.index=0;editSave(panel);close_edit();dismiss()">Save</button>
<button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss()">Cancel</button>
</div>
\ No newline at end of file
......@@ -114,7 +114,6 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
// as their default
if (Modernizr.localstorage) {
if(!(_.isUndefined(window.localStorage['dashboard'])) && window.localStorage['dashboard'] !== '') {
console.log(window.localStorage['dashboard']);
$location.path(config.default_route);
alertSrv.set('Saving to browser storage has been replaced',' with saving to Elasticsearch.'+
' Click <a href="#/dashboard/local/deprecated">here</a> to load your old dashboard anyway.');
......@@ -247,7 +246,6 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
};
this.set_default = function(route) {
console.log(route);
if (Modernizr.localstorage) {
// Purge any old dashboards
if(!_.isUndefined(window.localStorage['dashboard'])) {
......
@import url('//fonts.googleapis.com/css?family=Droid+Sans:400,700');/*!
/*!
* Bootstrap v2.3.2
*
* Copyright 2013 Twitter, Inc
......
......@@ -5,8 +5,6 @@
// TYPOGRAPHY
// -----------------------------------------------------
@import url('//fonts.googleapis.com/css?family=Droid+Sans:400,700');
label, input, button, select, textarea,
.navbar .search-query:-moz-placeholder,
.navbar .search-query::-webkit-input-placeholder {
......
......@@ -6,8 +6,6 @@
// TYPOGRAPHY
// -----------------------------------------------------
//@import url('//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700');
body {
font-weight: 300;
background: @bodyBackground url('../img/light.png') repeat right top;
......
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