From 038c380bd624238dcbe8639093c2933be513ee5b Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Tue, 20 Oct 2009 12:18:09 -0600 Subject: [PATCH] Minor JavaScript fixes Move some JavaScript to the external file, and make sure that the modified warning doesn't pop up when "Cancel" is used. --- .../prog/en/js/pages/preferences.js | 16 ++++++++++++++++ .../prog/en/modules/admin/preferences.tmpl | 19 ++----------------- 2 files changed, 18 insertions(+), 17 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 bbc0b1bf61..e1688bd459 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js @@ -57,4 +57,20 @@ $( document ).ready( function () { return _( "You have made changes to system preferences." ); } } + + $("h3").attr("class","expanded").attr("title",_("Click to expand this section")); + var collapsible = $(".collapsed,.expanded"); + + $(collapsible).toggle( + function () { + $(this).addClass("collapsed").removeClass("expanded").attr("title",_("Click to expand this section")); + $(this).next("table").hide(); + }, + function () { + $(this).addClass("expanded").removeClass("collapsed").attr("title",_("Click to collapse this section")); + $(this).next("table").show(); + } + ); + + $( '.prefs-tab .action .cancel' ).click( function () { KOHA.Preferences.Modified = false } ); } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl index 1e7c11662b..1f9c66cb33 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl @@ -8,23 +8,8 @@