From 82e40230a82debd05b7cc6f83130e0fe8b3c33a4 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Sun, 26 May 2013 09:38:18 -0700 Subject: [PATCH] Fixed bug in pie editor, switched up edit icon, added ability to disable drag to select in histogram --- index.html | 17 +++++++++-------- js/app.js | 8 ++++---- js/directives.js | 4 ++-- panels/histogram/editor.html | 3 ++- panels/histogram/module.js | 17 ++++++++++------- panels/pie/editor.html | 8 ++++---- partials/dashboard.html | 2 +- 7 files changed, 32 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index ce4cae0a61d..a1e471a87fd 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,14 @@ + + + + + + + + @@ -32,7 +40,7 @@
{{dashboards.title}} -
+
@@ -43,11 +51,4 @@ - - - - - - - diff --git a/js/app.js b/js/app.js index 751fcbdfc83..2040ac3f18c 100644 --- a/js/app.js +++ b/js/app.js @@ -17,12 +17,9 @@ var modules = [ var scripts = [] var labjs = $LAB - .script("common/lib/jquery-1.8.0.min.js").wait() + .script("common/lib/jquery-1.8.0.min.js") .script("common/lib/modernizr-2.6.1.min.js") .script("common/lib/underscore.min.js") - .script("common/lib/bootstrap.min.js") - .script('common/lib/datepicker.js') - .script('common/lib/timepicker.js') .script("common/lib/angular.min.js") .script("common/lib/angular-strap.min.js") .script("common/lib/angular-sanitize.min.js") @@ -31,6 +28,9 @@ var labjs = $LAB .script("common/lib/moment.js") .script("common/lib/shared.js") .script("common/lib/filesaver.js") + .script("common/lib/bootstrap.min.js") + .script('common/lib/datepicker.js') + .script('common/lib/timepicker.js') .script("js/services.js") .script("js/controllers.js") .script("js/filters.js") diff --git a/js/directives.js b/js/directives.js index ddc058ec014..d44e6b923df 100644 --- a/js/directives.js +++ b/js/directives.js @@ -8,8 +8,8 @@ angular.module('kibana.directives', []) restrict: 'E', link: function(scope, elem, attrs) { var template = ''+ - ''+ - '{{panel.type}} '+ + ' '+ + '{{panel.type}} '+ '

{{panel.title}}

'; elem.prepend($compile(angular.element(template))(scope)); } diff --git a/panels/histogram/editor.html b/panels/histogram/editor.html index dd3c2a43544..53cb0c849fd 100644 --- a/panels/histogram/editor.html +++ b/panels/histogram/editor.html @@ -66,10 +66,11 @@
-
+
+
diff --git a/panels/histogram/module.js b/panels/histogram/module.js index d91c0de992d..cbbc68e14a4 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -31,6 +31,7 @@ * legend :: Show the legend? * x-axis :: Show x-axis labels and grid lines * y-axis :: Show y-axis labels and grid lines + * interactive :: Allow drag to select time range ### Group Events #### Receives * time :: An object containing the time range to use and the index(es) to query @@ -64,7 +65,8 @@ angular.module('kibana.histogram', []) legend : true, 'x-axis' : true, 'y-axis' : true, - percentage : false + percentage : false, + interactive : true, } _.defaults($scope.panel,_d) @@ -288,7 +290,7 @@ angular.module('kibana.histogram', []) // Populate element try { - scope.plot = $.plot(elem, scope.data, { + var options = { legend: { show: false }, series: { stackpercent: scope.panel.stack ? scope.panel.percentage : false, @@ -317,10 +319,6 @@ angular.module('kibana.histogram', []) label: "Datetime", color: "#c8c8c8", }, - selection: { - mode: "x", - color: '#ccc' - }, grid: { backgroundColor: null, borderWidth: 0, @@ -329,7 +327,12 @@ angular.module('kibana.histogram', []) hoverable: true, }, colors: ['#86B22D','#BF6730','#1D7373','#BFB930','#BF3030','#77207D'] - }) + } + + if(scope.panel.interactive) + options.selection = { mode: "x", color: '#aaa' }; + + scope.plot = $.plot(elem, scope.data, options) // Work around for missing legend at initialization if(!scope.$$phase) diff --git a/panels/pie/editor.html b/panels/pie/editor.html index 9411e027630..bd5d5de33cc 100644 --- a/panels/pie/editor.html +++ b/panels/pie/editor.html @@ -1,10 +1,10 @@
+
+ + +
-
- - -
diff --git a/partials/dashboard.html b/partials/dashboard.html index 0d9f5ba16bf..5e7ec05602a 100644 --- a/partials/dashboard.html +++ b/partials/dashboard.html @@ -9,7 +9,7 @@
{{row.title}} - +
{{row.title}}