diff --git a/src/ui/public/ConfigTemplate.js b/src/ui/public/ConfigTemplate.js index 3b8307ab8481a..13026f55de5d3 100644 --- a/src/ui/public/ConfigTemplate.js +++ b/src/ui/public/ConfigTemplate.js @@ -1,16 +1,16 @@ define(function (require) { - var _ = require('lodash'); + const _ = require('lodash'); function ConfigTemplate(templates) { - var template = this; + const template = this; template.current = null; template.toggle = _.partial(update, null); template.open = _.partial(update, true); template.close = _.partial(update, false); function update(newState, name) { - var toUpdate = templates[name]; - var curState = template.is(name); + const toUpdate = templates[name]; + const curState = template.is(name); if (newState == null) newState = !curState; if (newState) { diff --git a/src/ui/public/bound_to_config_obj.js b/src/ui/public/bound_to_config_obj.js index a16487835a6c1..9ca2e6b00f615 100644 --- a/src/ui/public/bound_to_config_obj.js +++ b/src/ui/public/bound_to_config_obj.js @@ -1,6 +1,6 @@ define(function (require) { return function BoundToConfigObjProvider($rootScope, config) { - var _ = require('lodash'); + const _ = require('lodash'); /** * Create an object with properties that may be bound to config values. @@ -17,7 +17,7 @@ define(function (require) { * @return {Object} */ function BoundToConfigObj(input) { - var self = this; + const self = this; _.forOwn(input, function (val, prop) { if (!_.isString(val) || val.charAt(0) !== '=') { @@ -25,7 +25,7 @@ define(function (require) { return; } - var configKey = val.substr(1); + const configKey = val.substr(1); update(); $rootScope.$on('init:config', update); diff --git a/src/ui/public/compile_recursive_directive.js b/src/ui/public/compile_recursive_directive.js index 9d9a52037951d..0de7bfa3c5f40 100644 --- a/src/ui/public/compile_recursive_directive.js +++ b/src/ui/public/compile_recursive_directive.js @@ -1,5 +1,5 @@ define(function (require) { - var _ = require('lodash'); + const _ = require('lodash'); /** * Angular can't render directives that render themselves recursively: @@ -25,7 +25,7 @@ define(function (require) { } // Break the recursion loop by removing the contents - var contents = element.contents().remove(); + const contents = element.contents().remove(); let compiledContents; return { pre: (link && link.pre) ? link.pre : null, diff --git a/src/ui/public/elastic_textarea.js b/src/ui/public/elastic_textarea.js index 8ae6372b09c2e..e0be2b95566ae 100644 --- a/src/ui/public/elastic_textarea.js +++ b/src/ui/public/elastic_textarea.js @@ -1,7 +1,7 @@ define(function (require) { - var _ = require('lodash'); - var NL_RE = /\n/g; - var events = 'keydown keypress keyup change'; + const _ = require('lodash'); + const NL_RE = /\n/g; + const events = 'keydown keypress keyup change'; require('ui/modules').get('kibana') .directive('elasticTextarea', function () { diff --git a/src/ui/public/errors.js b/src/ui/public/errors.js index ab7cb6c125552..98efdc613e0c2 100644 --- a/src/ui/public/errors.js +++ b/src/ui/public/errors.js @@ -1,13 +1,13 @@ define(function (require) { - var _ = require('lodash'); - var angular = require('angular'); + const _ = require('lodash'); + const angular = require('angular'); - var canStack = (function () { - var err = new Error(); + const canStack = (function () { + const err = new Error(); return !!err.stack; }()); - var errors = {}; + const errors = {}; // abstract error class function KbnError(msg, constructor) { @@ -120,7 +120,7 @@ define(function (require) { * @param {String} field - the fields which contains the conflict */ errors.RestrictedMapping = function RestrictedMapping(field, index) { - var msg = field + ' is a restricted field name'; + let msg = field + ' is a restricted field name'; if (index) msg += ', found it while attempting to fetch mapping for index pattern: ' + index; KbnError.call(this, msg, errors.RestrictedMapping); @@ -166,7 +166,7 @@ define(function (require) { errors.SavedObjectNotFound = function SavedObjectNotFound(type, id) { this.savedObjectType = type; this.savedObjectId = id; - var idMsg = id ? ' (id: ' + id + ')' : ''; + const idMsg = id ? ' (id: ' + id + ')' : ''; KbnError.call(this, 'Could not locate that ' + type + idMsg, errors.SavedObjectNotFound); diff --git a/src/ui/public/es.js b/src/ui/public/es.js index 43fa5fdecec40..bb561c0974178 100644 --- a/src/ui/public/es.js +++ b/src/ui/public/es.js @@ -1,6 +1,6 @@ define(function (require) { require('elasticsearch-browser/elasticsearch.angular.js'); - var _ = require('lodash'); + const _ = require('lodash'); let es; // share the client amoungst all apps require('ui/modules') diff --git a/src/ui/public/events.js b/src/ui/public/events.js index b0c91470d4ce7..bb9b287adf961 100644 --- a/src/ui/public/events.js +++ b/src/ui/public/events.js @@ -1,10 +1,10 @@ define(function (require) { - var _ = require('lodash'); - var Notifier = require('ui/notify/notifier'); + const _ = require('lodash'); + const Notifier = require('ui/notify/notifier'); return function EventsProvider(Private, Promise) { - var SimpleEmitter = require('ui/utils/SimpleEmitter'); - var notify = new Notifier({ location: 'EventEmitter' }); + const SimpleEmitter = require('ui/utils/SimpleEmitter'); + const notify = new Notifier({ location: 'EventEmitter' }); _.class(Events).inherits(SimpleEmitter); function Events() { @@ -24,7 +24,7 @@ define(function (require) { this._listeners[name] = []; } - var listener = { + const listener = { handler: handler }; this._listeners[name].push(listener); @@ -76,8 +76,8 @@ define(function (require) { * @returns {Promise} */ Events.prototype.emit = function (name) { - var self = this; - var args = _.rest(arguments); + const self = this; + const args = _.rest(arguments); if (!self._listeners[name]) { return self._emitChain; diff --git a/src/ui/public/fixedScroll.js b/src/ui/public/fixedScroll.js index d8381b818eadf..9892ebc6d28d6 100644 --- a/src/ui/public/fixedScroll.js +++ b/src/ui/public/fixedScroll.js @@ -1,8 +1,8 @@ define(function (require) { - var $ = require('jquery'); - var _ = require('lodash'); + const $ = require('jquery'); + const _ = require('lodash'); - var SCROLLER_HEIGHT = 20; + const SCROLLER_HEIGHT = 20; require('ui/modules') .get('kibana') @@ -10,15 +10,15 @@ define(function (require) { return { restrict: 'A', link: function ($scope, $el) { - var $window = $(window); - var $scroller = $('