diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc index c51ab8fb49..6df08dbef6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -99,8 +99,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr return $result[0]; }, postCreate: function() { - var value = defaultvalue; var widget = this; + var value = widget.text || defaultvalue; $.each( authvals, function() { if ( this.value == widget.text ) { @@ -112,9 +112,18 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr $( '' ).appendTo( this.node ); var $node = $( this.node ).find( 'select' ); + var matched = false; $.each( authvals, function( undef, authval ) { - $node.append( '' ); + selected = ''; + if (authval.value == value){ + matched=true; + selected = ' selected="selected" '; + }; + $node.append( '' ); } ); + if( !matched ){ + $node.append( '' ); + } $node.val( this.text ); $node.change( $.proxy( function() {