From dcdea1d8ccb3d18794031b83ef3ddf79ce5a7ec9 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Tue, 27 Aug 2013 10:33:37 -0700 Subject: [PATCH] Fixing merge conflict --- .gitignore | 1 + .jshintrc | 40 ++++++++++++++++++++++++++++++++++++++ Gruntfile.js | 31 ++--------------------------- panels/histogram/module.js | 12 ++++++------ 4 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 .gitignore create mode 100644 .jshintrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..b512c09d476 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 00000000000..2092e6445e0 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,40 @@ +{ + "jquery": true, + "browser": true, + + "bitwise":false, + "curly": true, + "eqnull": true, + "globalstrict": true, + "devel": true, + "eqeqeq": true, + "forin": false, + "immed": true, + "supernew": true, + "expr": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "undef": true, + "boss": true, + "trailing": false, + "laxbreak": true, + "laxcomma": true, + "sub": true, + + "maxlen": 140, + + "globals": { + "$LAB": false, + "_": false, + "$": false, + "kbn" : false, + "angular" : false, + "exports": true, + "module": false, + "config": false, + "moment": false + } +} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 4e05a3067bc..1d640ff229b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,34 +17,7 @@ module.exports = function (grunt) { jshint: { files: ['Gruntfile.js', 'js/*.js', 'panels/*/*.js' ], options: { - bitwise: true, - maxlen: 140, - curly: true, - eqeqeq: true, - immed: true, - indent: 2, - latedef: true, - newcap: true, - noarg: true, - sub: true, - undef: true, - boss: true, - eqnull: true, - globalstrict: true, - devel: true, - node: true, - globals: { - '$LAB': false, - '_': false, - '$': false, - 'kbn' : false, - window: false, - document: false, - exports: true, - module: false, - config: false, - moment: false - } + jshintrc: '.jshintrc' } }, less: { @@ -70,4 +43,4 @@ module.exports = function (grunt) { // Default task. grunt.registerTask('default', ['jshint','less']); -}; +}; \ No newline at end of file diff --git a/panels/histogram/module.js b/panels/histogram/module.js index fe7de099773..e8b3a9c71b7 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -392,9 +392,9 @@ angular.module('kibana.histogram', []) // so that the stacking happens in the proper order var required_times = []; if (scope.panel.bars && stack) { - required_times = Array.prototype.concat.apply([], _.map(scope.data, function (series) { - return series.time_series.getOrderedTimes(); - })); + required_times = _.uniq(Array.prototype.concat.apply([], _.map(scope.data, function (query) { + return query.time_series.getOrderedTimes(); + })).sort(), true); } for (var i = 0; i < scope.data.length; i++) { @@ -532,11 +532,11 @@ angular.module('kibana.histogram', []) * @return {array} An array of integer times. */ this.ZeroFilled.prototype.getOrderedTimes = function (include) { - var times = _.map(_.keys(this._data), base10Int).sort(); + var times = _.map(_.keys(this._data), base10Int); if (_.isArray(include)) { times = times.concat(include); } - return times; + return _.uniq(times.sort(), true); }; /** @@ -618,4 +618,4 @@ angular.module('kibana.histogram', []) return result; }; -}); \ No newline at end of file +});