|
@@ -104,6 +104,7 @@ $(document).ready(function () {
|
|
initQuillEdit();
|
|
initQuillEdit();
|
|
initFastLoad();
|
|
initFastLoad();
|
|
initPrimaryForm();
|
|
initPrimaryForm();
|
|
|
|
+ initPatientPresenceIndicator();
|
|
if(typeof initializeCalendar !== 'undefined') {
|
|
if(typeof initializeCalendar !== 'undefined') {
|
|
initializeCalendar();
|
|
initializeCalendar();
|
|
}
|
|
}
|
|
@@ -215,6 +216,7 @@ function onFastLoaded(_data, _href, _history) {
|
|
initQuillEdit();
|
|
initQuillEdit();
|
|
initFastLoad(targetParent);
|
|
initFastLoad(targetParent);
|
|
initPrimaryForm();
|
|
initPrimaryForm();
|
|
|
|
+ initPatientPresenceIndicator();
|
|
$(window).scrollTop(0);
|
|
$(window).scrollTop(0);
|
|
}, 50);
|
|
}, 50);
|
|
if(typeof initializeCalendar !== 'undefined') {
|
|
if(typeof initializeCalendar !== 'undefined') {
|
|
@@ -324,6 +326,7 @@ function initQuillEdit(_selector = '.note-content[auto-edit]') {
|
|
$(this).attr('auto-edit', 1);
|
|
$(this).attr('auto-edit', 1);
|
|
initQuillEdit();
|
|
initQuillEdit();
|
|
initPrimaryForm();
|
|
initPrimaryForm();
|
|
|
|
+ initPatientPresenceIndicator();
|
|
});
|
|
});
|
|
|
|
|
|
if(!$(_selector).length) return;
|
|
if(!$(_selector).length) return;
|
|
@@ -354,4 +357,26 @@ function initQuillEdit(_selector = '.note-content[auto-edit]') {
|
|
// });
|
|
// });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function initPatientPresenceIndicator() {
|
|
|
|
+ var presenceTimer = false;
|
|
|
|
+ if(presenceTimer !== false) {
|
|
|
|
+ window.clearInterval(presenceTimer);
|
|
|
|
+ presenceTimer = false;
|
|
|
|
+ }
|
|
|
|
+ var elem = $('.patient-presence-indicator[data-patient-uid]');
|
|
|
|
+ if(elem.length) {
|
|
|
|
+ var patientUid = elem.attr('data-patient-uid');
|
|
|
|
+ presenceTimer = window.setInterval(function() {
|
|
|
|
+ $.get('/patients/' + patientUid + '/presence', function(_data) {
|
|
|
|
+ if(_data.online) {
|
|
|
|
+ elem.addClass('online');
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ elem.removeClass('online');
|
|
|
|
+ }
|
|
|
|
+ }, 'json');
|
|
|
|
+ }, 2500);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|