ohif-viewer/LesionTracker/client/components/lesionTrackerLayout/lesionTrackerLayout.js
Aysel Afsar 5ec3cace94 LT-107: Add countdown dialog
- Remove ui from meteor-stale-session package
2016-02-09 22:16:37 -05:00

41 lines
1.2 KiB
JavaScript

Template.layoutLesionTracker.events({
'click #logoutButton': function() {
Meteor.logout(function(){
Router.go('/entrySignIn');
});
}
});
Template.layoutLesionTracker.helpers({
'fullName': function() {
return Meteor.user().profile.fullName;
}
});
Template.layoutLesionTracker.onCreated(function() {
// Show countdown dialog
var handle;
$(document).on('TriggerOpenTimeoutCountdownDialog', function (e, leftTime) {
// TODO: Show modal dialog
handle = setInterval(function() {
leftTime --;
// Set countdownDialogLeftTime session
Session.set("countdownDialogLeftTime", leftTime);
// Show dialog
if ($("#timeoutCountdownDialog").css("display") == "none") {
$("#timeoutCountdownDialog").css("display", "block");
}
}, 1000);
});
$(document).on('TriggerCloseTimeoutCountdownDialog', function (e) {
$("#timeoutCountdownDialog").css("display", "none");
if (handle) {
clearInterval(handle);
// Close the dialog
$("#timeoutCountdownDialog").css("display", "none");
}
});
});