|
Lines 243-249
require( [ 'koha-backend', 'widget', 'text-marc' ], function( KohaBackend, Widge
Link Here
|
| 243 |
return this.materialTypeMapping[this.text.substring(0, 1)]; |
243 |
return this.materialTypeMapping[this.text.substring(0, 1)]; |
| 244 |
}, |
244 |
}, |
| 245 |
postCreate: function( node, mark ) { |
245 |
postCreate: function( node, mark ) { |
| 246 |
this.createFromXML( 'marc21/xml/007' ); |
246 |
this.createFromXML( 'marc21/xml/007' ).then(() => { |
|
|
247 |
$(this.node).find('.material-select').on('change', (e) => { |
| 248 |
const keys = Object.keys(this.materialTypeMapping); |
| 249 |
const k = keys.filter(k => this.materialTypeMapping[k] === $(e.target).val()); |
| 250 |
this.setFixed(0, 1, k, '+input'); |
| 251 |
|
| 252 |
// FIXME There must be a better way to update display |
| 253 |
const n = $(this.node).find('[name="f00"]'); |
| 254 |
n.triggerHandler('focus'); |
| 255 |
n.triggerHandler('blur'); |
| 256 |
}); |
| 257 |
}); |
| 247 |
} |
258 |
} |
| 248 |
} ); |
259 |
} ); |
| 249 |
|
260 |
|
| 250 |
- |
|
|