@@ -, +, @@
---
.../intranet-tmpl/prog/en/includes/cateditor-ui.inc | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc
+++ a/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() {
--