Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request elastic#41 from spalger/iamwelcome
Browse files Browse the repository at this point in the history
Reshow welcome when page refreshed
  • Loading branch information
spalger committed Oct 23, 2015
2 parents 75bebdc + 9a4543b commit b18c390
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion public/src/controllers/SenseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ require('ui/modules')
*/
if (!storage.get('version_welcome_shown')) {
this.dropdown.open('welcome');
storage.set('version_welcome_shown', '@@SENSE_REVISION');
}

this.sendSelected = () => {
Expand Down
14 changes: 13 additions & 1 deletion public/src/directives/senseWelcome.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
require('./senseHelpExample');

const storage = require('../storage');

require('ui/modules')
.get('app/sense')
.directive('senseWelcome', function () {
return {
restrict: 'E',
template: require('./welcome.html')
template: require('./welcome.html'),
link: function ($scope) {
// date junk is a work around for https://github.com/elastic/kibana/pull/5167
var shown = Date.now();

$scope.$on('$destroy', function () {
if (Date.now() - shown > 1000) {
storage.set('version_welcome_shown', '@@SENSE_REVISION');
}
});
}
}
});

0 comments on commit b18c390

Please sign in to comment.