Lesion Tracker Redesign so far
This commit is contained in:
1 parent
b247e89d8b
commit
a9a4f3f82b
109 files changed
+2972
-936
No files matched your search
+2
-2
@@ -1,10 +1,10 @@
|
||||
<template name="timeoutCountdownDialog">
|
||||
<div id="timeoutCountdownDialog">
|
||||
<div class="dialogHeader">
|
||||
<h5>Session is about to expire!</h5>
|
||||
<h5>Your session is about to expire.</h5>
|
||||
</div>
|
||||
<div class="dialogContent">
|
||||
<p>You will be log out in {{leftTime}} {{secondsText}}.</p>
|
||||
<p>You will be logged out in {{timeLeft}}.</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+37
-7
@@ -1,9 +1,39 @@
|
||||
|
||||
Template.timeoutCountdownDialog.helpers({
|
||||
leftTime: function(e) {
|
||||
return Session.get("countdownDialogLeftTime");
|
||||
},
|
||||
secondsText: function() {
|
||||
return Session.get("countdownDialogLeftTime") > 1? "seconds": "second";
|
||||
timeLeft: function() {
|
||||
var timeLeft = Session.get('countdownDialogLeftTime');
|
||||
var suffix = timeLeft > 1 ? 'seconds': 'second';
|
||||
return timeLeft + suffix;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Template.timeoutCountdownDialog.onRendered(function() {
|
||||
// Show countdown dialog
|
||||
var timeoutCountdownInterval;
|
||||
$(document).on('TriggerOpenTimeoutCountdownDialog', function(e, leftTime) {
|
||||
// Show modal dialog
|
||||
timeoutCountdownInterval = setInterval(function() {
|
||||
// Set countdownDialogLeftTime session
|
||||
Session.set('countdownDialogLeftTime', --leftTime);
|
||||
|
||||
var dialog = $('#timeoutCountdownDialog');
|
||||
|
||||
// Show dialog
|
||||
dialog.css('display', 'block');
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
|
||||
$(document).on('TriggerCloseTimeoutCountdownDialog', function() {
|
||||
var dialog = $('#timeoutCountdownDialog');
|
||||
|
||||
// Close the dialog
|
||||
dialog.css('display', 'none');
|
||||
|
||||
if (timeoutCountdownInterval) {
|
||||
clearInterval(timeoutCountdownInterval);
|
||||
|
||||
// Remove reviewer info for the user
|
||||
Meteor.call('removeUserFromReviewers', Meteor.userId());
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user