diff options
Diffstat (limited to 'admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js')
-rw-r--r-- | admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js b/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js new file mode 100644 index 0000000..cc9d46b --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js @@ -0,0 +1,20 @@ +// EVENT LEAVE PAGE, ki se mora izvajati sinhrono (drugace se pri nekaterih browserjih izgubi)
+$(function () {
+
+ // LEAVE PAGE (gledamo unload, beforeunload, klik na submit, klik na back)
+ var leavePageFunction_called = false;
+ var leavePageFunction = function (){
+ var event_type = 'page';
+ var event = 'unload_page';
+
+ if(!leavePageFunction_called){
+ logEvent(event_type, event);
+ leavePageFunction_called = true;
+ }
+ }
+ window.addEventListener('beforeunload', leavePageFunction);
+ window.addEventListener('unload', leavePageFunction);
+ $("input.next:submit").bind('click', leavePageFunction);
+ $("input.prev:button").bind('click', leavePageFunction);
+
+})
\ No newline at end of file |