diff --git a/src/kibana/components/notify/notify.js b/src/kibana/components/notify/notify.js index fedcde19e91f7..201adf7bcafbf 100644 --- a/src/kibana/components/notify/notify.js +++ b/src/kibana/components/notify/notify.js @@ -1,6 +1,5 @@ define(function (require) { var _ = require('lodash'); - var nextTick = require('utils/next_tick'); var $ = require('jquery'); var modules = require('modules'); var module = modules.get('kibana/notify'); diff --git a/src/kibana/utils/next_tick.js b/src/kibana/utils/next_tick.js deleted file mode 100644 index bf3278b7aa5e1..0000000000000 --- a/src/kibana/utils/next_tick.js +++ /dev/null @@ -1,44 +0,0 @@ -define(function () { - - var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; - var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener - ; - - if (canSetImmediate) { - return function (f) { return window.setImmediate(f); }; - } - - if (canPost) { - var queue = []; - window.addEventListener('message', function (ev) { - if (ev.source === window && ev.data === 'process-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - if (typeof fn === 'function') { - fn(); - } else { - // partial args were supplied - var args = fn; - fn = args.shift(); - fn.apply(null, args); - } - } - } - }, true); - - return function nextTick(fn) { - if (arguments.length > 1) { - queue.push([fn].concat([].slice.call(arguments, 1))); - } else { - queue.push(fn); - } - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; - -}); \ No newline at end of file diff --git a/src/server/dev/index.js b/src/server/dev/index.js index 84a037c603caf..82daed130d720 100644 --- a/src/server/dev/index.js +++ b/src/server/dev/index.js @@ -19,7 +19,7 @@ module.exports = function (app) { filter: function (filename) { return filename.match(/.*\/src\/.*\.js$/) && !filename.match(/.*\/src\/kibana\/bower_components\/.*\.js$/) - && !filename.match(/.*\/src\/kibana\/utils\/(event_emitter|next_tick|rison)\.js$/); + && !filename.match(/.*\/src\/kibana\/utils\/(event_emitter|rison)\.js$/); } })); @@ -29,7 +29,7 @@ module.exports = function (app) { filter: function (filename) { return filename.match(/.*\/src\/.*\.js$/) && !filename.match(/.*\/src\/kibana\/bower_components\/.*\.js$/) - && !filename.match(/.*\/src\/kibana\/utils\/(event_emitter|next_tick|rison)\.js$/); + && !filename.match(/.*\/src\/kibana\/utils\/(event_emitter|rison)\.js$/); } }));