diff --git a/files/usr/local/lib/python2.7/site-packages/nclock/web/js/settings.js b/files/usr/local/lib/python2.7/site-packages/nclock/web/js/settings.js index b60de36..cfc27b8 100644 --- a/files/usr/local/lib/python2.7/site-packages/nclock/web/js/settings.js +++ b/files/usr/local/lib/python2.7/site-packages/nclock/web/js/settings.js @@ -1,7 +1,10 @@ // Update settings before leaving page. $(window).bind('beforeunload', function(){ - console.log("Updating alarm with current settings before leaving page."); - saveSettings(); + if(document.getElementById("select_sound").is(':focus') || + document.getElementById("alarm_time").is(':focus')) { + console.log("Updating alarm with current settings before leaving page."); + saveSettings(); + } }); (function(window, document) {