From 20b3a5d3f542a7fba3a815fefdd26b20cbba583c Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Tue, 24 Dec 2013 12:56:05 -0700 Subject: [PATCH] Added save button to panel editors --- src/app/directives/configModal.js | 14 +++++++++++--- src/app/panels/terms/module.js | 8 -------- src/app/partials/paneleditor.html | 3 ++- src/app/services/dashboard.js | 2 -- src/css/bootstrap.dark.min.css | 2 +- src/vendor/bootstrap/less/bootswatch.dark.less | 2 -- src/vendor/bootstrap/less/bootswatch.light.less | 2 -- 7 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/app/directives/configModal.js b/src/app/directives/configModal.js index 4755dfb76e3..49516056e01 100644 --- a/src/app/directives/configModal.js +++ b/src/app/directives/configModal.js @@ -1,6 +1,5 @@ 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 }); diff --git a/src/app/panels/terms/module.js b/src/app/panels/terms/module.js index 5a1e353e517..fa19b021cf5 100644 --- a/src/app/panels/terms/module.js +++ b/src/app/panels/terms/module.js @@ -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(); diff --git a/src/app/partials/paneleditor.html b/src/app/partials/paneleditor.html index 6ed68501eb1..d66070b8d04 100644 --- a/src/app/partials/paneleditor.html +++ b/src/app/partials/paneleditor.html @@ -19,5 +19,6 @@ \ No newline at end of file diff --git a/src/app/services/dashboard.js b/src/app/services/dashboard.js index bf04823fabc..6f7a3bbeb22 100644 --- a/src/app/services/dashboard.js +++ b/src/app/services/dashboard.js @@ -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 here 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'])) { diff --git a/src/css/bootstrap.dark.min.css b/src/css/bootstrap.dark.min.css index 3550641f5ab..133a050e180 100644 --- a/src/css/bootstrap.dark.min.css +++ b/src/css/bootstrap.dark.min.css @@ -1,4 +1,4 @@ -@import url('//fonts.googleapis.com/css?family=Droid+Sans:400,700');/*! +/*! * Bootstrap v2.3.2 * * Copyright 2013 Twitter, Inc diff --git a/src/vendor/bootstrap/less/bootswatch.dark.less b/src/vendor/bootstrap/less/bootswatch.dark.less index 8a74d0b5c24..e1b4c63b8c7 100644 --- a/src/vendor/bootstrap/less/bootswatch.dark.less +++ b/src/vendor/bootstrap/less/bootswatch.dark.less @@ -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 { diff --git a/src/vendor/bootstrap/less/bootswatch.light.less b/src/vendor/bootstrap/less/bootswatch.light.less index 72dcc64dbf8..292c687b702 100644 --- a/src/vendor/bootstrap/less/bootswatch.light.less +++ b/src/vendor/bootstrap/less/bootswatch.light.less @@ -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;