Lines 77-88
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
77 |
return $result[0]; |
77 |
return $result[0]; |
78 |
}, |
78 |
}, |
79 |
postCreate: function() { |
79 |
postCreate: function() { |
80 |
this.setText( defaultvalue ); |
80 |
var value = defaultvalue; |
|
|
81 |
var widget = this; |
82 |
|
83 |
$.each( authvals, function() { |
84 |
if ( this.value == widget.text ) { |
85 |
value = this.value; |
86 |
} |
87 |
} ); |
88 |
|
89 |
this.setText( value ); |
81 |
|
90 |
|
82 |
$( '<select></select>' ).appendTo( this.node ); |
91 |
$( '<select></select>' ).appendTo( this.node ); |
83 |
var $node = $( this.node ).find( 'select' ); |
92 |
var $node = $( this.node ).find( 'select' ); |
84 |
$.each( authvals, function( undef, authval ) { |
93 |
$.each( authvals, function( undef, authval ) { |
85 |
$node.append( '<option value="' + authval.value + '"' + (authval.value == defaultvalue ? ' selected="selected"' : '') + '>' + authval.lib + '</option>' ); |
94 |
$node.append( '<option value="' + authval.value + '"' + (authval.value == value ? ' selected="selected"' : '') + '>' + authval.lib + '</option>' ); |
86 |
} ); |
95 |
} ); |
87 |
$node.val( this.text ); |
96 |
$node.val( this.text ); |
88 |
|
97 |
|
89 |
- |
|
|