X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=koha-tmpl%2Fintranet-tmpl%2Fprog%2Fen%2Fjs%2Fpages%2Fpreferences.js;h=96e9e99668f034bc307b373e80d165af5edc8823;hb=1e4876536ff876ea61e90bd9b5b99533ffb82115;hp=93dfaac708e98b39c83768a353979cf9fbdb812c;hpb=a52d4e8a70783fdf9cf4429931c2d133331d7ef5;p=koha_fer 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 93dfaac708..96e9e99668 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js @@ -1,10 +1,3 @@ -$(document).ready(function() { - $("table.preferences").tablesorter({ - sortList: [[0,0]], - headers: { 1: { sorter:false}} - }); -}); - // We can assume 'KOHA' exists, as we depend on KOHA.AJAX KOHA.Preferences = { @@ -40,6 +33,15 @@ KOHA.Preferences = { }; $( document ).ready( function () { + + $("table.preferences").dataTable($.extend(true, {}, dataTablesDefaults, { + "sDom": 't', + "aoColumnDefs": [ + { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false } + ], + "bPaginate": false + })); + function mark_modified() { $( this.form ).find( '.save-all' ).removeAttr( 'disabled' ); $( this ).addClass( 'modified' ); @@ -59,6 +61,16 @@ $( document ).ready( function () { mark_modified.call(this); } ); + $(".set_syspref").click(function() { + var s = $(this).attr('data-syspref'); + var v = $(this).attr('data-value'); + // populate the input with the value in data-value + $("#pref_"+s).val(v); + // pass the DOM element to trigger "modified" to enable submit button + mark_modified.call($("#pref_"+s)[0]); + return false; + }); + window.onbeforeunload = function () { if ( KOHA.Preferences.Modified ) { return MSG_MADE_CHANGES; @@ -86,11 +98,11 @@ $( document ).ready( function () { $(collapsible).toggle( function () { $(this).addClass("collapsed").removeClass("expanded").attr("title",MSG_CLICK_TO_EXPAND); - $(this).next("table").hide(); + $(this).next("div").hide(); }, function () { $(this).addClass("expanded").removeClass("collapsed").attr("title",MSG_CLICK_TO_COLLAPSE); - $(this).next("table").show(); + $(this).next("div").show(); } ); @@ -98,7 +110,7 @@ $( document ).ready( function () { var words = to_highlight.split( ' ' ); $( '.prefs-tab table' ).find( 'td, th' ).not( '.name-cell' ).each( function ( i, td ) { $.each( words, function ( i, word ) { $( td ).highlight( word ) } ); - } ).find( 'option' ).removeHighlight(); + } ).find( 'option, textarea' ).removeHighlight(); } if ( search_jumped ) {