From 1e24ba709ddef9555d03818ad4614c02269c3f69 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 8 Jan 2018 16:53:47 +0000 Subject: [PATCH] Bug 19267: Followup - only fire if changes and don't use javascript --- koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc index 3f047af..62f19b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -1077,9 +1077,12 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr return false; } ); - $(window).on( 'beforeunload', function() { - return editor.modified; - } ); + window.onbeforeunload = function() { + if(editor.modified ) + { return 1; } + else + { return undef; } + }; // Start editor Preferences.Load( [% USER_INFO.borrowernumber || 0 %] ); -- 2.1.4