From c4e86aca59c3fe12f8d7f779498380bc1a2ede13 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Sun, 1 Nov 2009 17:10:02 -0700 Subject: [PATCH] Bug 3739 - Issues with saving HTML fields --- .../intranet-tmpl/prog/en/js/pages/preferences.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js index e1688bd459..26686d2d4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js @@ -26,14 +26,20 @@ KOHA.Preferences = { }; $( document ).ready( function () { - $( '.prefs-tab .preference' ).change( function () { + function mark_modified() { $( this.form ).find( '.save-all' ).removeAttr( 'disabled' ); $( this ).addClass( 'modified' ); var name_cell = $( this ).parent().parent().find( '.name-cell' ); if ( !name_cell.find( '.modified-warning' ).length ) name_cell.append( '(modified)' ); KOHA.Preferences.Modified = true; - } ); + } + + $( '.prefs-tab' ) + .find( 'input.preference, textarea.preference' ).keyup( function () { + if ( this.defaultValue === undefined || this.value != this.defaultValue ) mark_modified.call( this ); + } ).end() + .find( 'select.preference' ).change( mark_modified ); if ( document.location.search.indexOf( 'jumpfield' ) != -1 ) { document.location.hash = "highlighted"; -- 2.39.5