Lines 3-9
Link Here
|
3 |
KOHA.Preferences = { |
3 |
KOHA.Preferences = { |
4 |
Save: function ( form ) { |
4 |
Save: function ( form ) { |
5 |
modified_prefs = $( form ).find( '.modified' ); |
5 |
modified_prefs = $( form ).find( '.modified' ); |
|
|
6 |
// $.serialize removes empty value, we need to keep them. |
7 |
// If a multiple select has all its entries unselected |
8 |
var unserialized = new Array(); |
9 |
$(modified_prefs).each(function(){ |
10 |
if ( $(this).attr('multiple') && $(this).val() == null ) { |
11 |
unserialized.push($(this)); |
12 |
} |
13 |
}); |
6 |
data = modified_prefs.serialize(); |
14 |
data = modified_prefs.serialize(); |
|
|
15 |
$(unserialized).each(function(){ |
16 |
data += '&' + $(this).attr('name') + '='; |
17 |
}); |
7 |
if ( !data ) { |
18 |
if ( !data ) { |
8 |
humanMsg.displayAlert( MSG_NOTHING_TO_SAVE ); |
19 |
humanMsg.displayAlert( MSG_NOTHING_TO_SAVE ); |
9 |
return; |
20 |
return; |
Lines 46-52
$( document ).ready( function () {
Link Here
|
46 |
$( this.form ).find( '.save-all' ).removeAttr( 'disabled' ); |
57 |
$( this.form ).find( '.save-all' ).removeAttr( 'disabled' ); |
47 |
$( this ).addClass( 'modified' ); |
58 |
$( this ).addClass( 'modified' ); |
48 |
var name_cell = $( this ).parents( '.name-row' ).find( '.name-cell' ); |
59 |
var name_cell = $( this ).parents( '.name-row' ).find( '.name-cell' ); |
49 |
if ( !name_cell.find( '.modified-warning' ).length ) |
60 |
if ( !name_cell.find( '.modified-warning' ).length ) |
50 |
name_cell.append( '<em class="modified-warning">('+MSG_MODIFIED+')</em>' ); |
61 |
name_cell.append( '<em class="modified-warning">('+MSG_MODIFIED+')</em>' ); |
51 |
KOHA.Preferences.Modified = true; |
62 |
KOHA.Preferences.Modified = true; |
52 |
} |
63 |
} |