View | Details | Raw Unified | Return to bug 21049
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js (-1 / +1 lines)
Lines 109-115 define( [ 'resources' ], function( Resources ) { Link Here
109
            createFromXML: function( resourceId ) {
109
            createFromXML: function( resourceId ) {
110
                var widget = this;
110
                var widget = this;
111
111
112
                Resources[resourceId].done( function( xml ) {
112
                return Resources[resourceId].done( function( xml ) {
113
                    $(widget.node).find('.widget-loading').remove();
113
                    $(widget.node).find('.widget-loading').remove();
114
                    var $matSelect = $('<select class="material-select"></select>').appendTo(widget.node);
114
                    var $matSelect = $('<select class="material-select"></select>').appendTo(widget.node);
115
                    var $contents = $('<span class="material-contents"/>').appendTo(widget.node);
115
                    var $contents = $('<span class="material-contents"/>').appendTo(widget.node);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc (-2 / +12 lines)
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
- 

Return to bug 21049