diff --git a/src/kibana/components/listen.js b/src/kibana/components/listen.js new file mode 100644 index 0000000000000..4954ec770c25e --- /dev/null +++ b/src/kibana/components/listen.js @@ -0,0 +1,24 @@ +define(function (require) { + var _ = require('lodash'); + + require('modules').get('kibana') + .run(function ($rootScope) { + + /** + * Helper that registers an event listener, and removes that listener when + * the $scope is destroyed. + * + * @param {EventEmitter} emitter - the event emitter to listen to + * @param {string} eventName - the event name + * @param {Function} handler - the event handler + * @return {undefined} + */ + $rootScope.constructor.prototype.$listen = function (emitter, eventName, handler) { + emitter.on(eventName, handler); + this.$on('$destroy', function () { + emitter.off(eventName, handler); + }); + }; + + }); +}); \ No newline at end of file diff --git a/src/kibana/components/notify/notify.js b/src/kibana/components/notify/notify.js index c9aaca5997d14..b9e9b02f44b2c 100644 --- a/src/kibana/components/notify/notify.js +++ b/src/kibana/components/notify/notify.js @@ -20,6 +20,11 @@ define(function (require) { return Notifier; }); + module.run(function ($timeout) { + // provide alternate methods for setting timeouts, which will properly trigger digest cycles + rootNotifier._setTimerFns($timeout, $timeout.cancel); + }); + /** * Global Angular exception handler (NOT JUST UNCAUGHT EXCEPTIONS) */ diff --git a/src/kibana/components/style_compile/style_compile.css.tmpl b/src/kibana/components/style_compile/style_compile.css.tmpl new file mode 100644 index 0000000000000..d640d6f61d4dc --- /dev/null +++ b/src/kibana/components/style_compile/style_compile.css.tmpl @@ -0,0 +1,6 @@ +.truncate-by-height { + max-height: <%= truncateMaxHeight %>; +} +.truncate-by-height::before { + top: <%= truncateGradientTop %>; +} \ No newline at end of file diff --git a/src/kibana/components/style_compile/style_compile.js b/src/kibana/components/style_compile/style_compile.js new file mode 100644 index 0000000000000..5ce60aca5acc1 --- /dev/null +++ b/src/kibana/components/style_compile/style_compile.js @@ -0,0 +1,32 @@ +define(function (require) { + var _ = require('lodash'); + var $ = require('jquery'); + var $style = $('