mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/master'
This commit is contained in:
		@@ -177,6 +177,11 @@ function inventreeDocReady() {
 | 
			
		||||
            'ui-autocomplete': 'dropdown-menu search-menu',
 | 
			
		||||
        },
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // Generate brand-icons
 | 
			
		||||
    $('.brand-icon').each(function(i, obj) {
 | 
			
		||||
        loadBrandIcon($(this), $(this).attr('brand_name'));
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isFileTransfer(transfer) {
 | 
			
		||||
@@ -275,3 +280,13 @@ function inventreeLoad(name, defaultValue) {
 | 
			
		||||
        return value;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function loadBrandIcon(element, name) {
 | 
			
		||||
    // check if icon exists
 | 
			
		||||
    var icon = window.FontAwesome.icon({prefix: 'fab', iconName: name});
 | 
			
		||||
 | 
			
		||||
    if (icon) {
 | 
			
		||||
        // add icon to button
 | 
			
		||||
        element.addClass('fab fa-' + name);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,18 @@ function bomItemFields() {
 | 
			
		||||
            hidden: true,
 | 
			
		||||
        },
 | 
			
		||||
        sub_part: {
 | 
			
		||||
            secondary: {
 | 
			
		||||
                title: '{% trans "New Part" %}',
 | 
			
		||||
                fields: function() {
 | 
			
		||||
                    var fields = partFields();
 | 
			
		||||
 | 
			
		||||
                    // Set to a "component" part
 | 
			
		||||
                    fields.component.value = true;
 | 
			
		||||
 | 
			
		||||
                    return fields;
 | 
			
		||||
                },
 | 
			
		||||
                groups: partGroups(),
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        quantity: {},
 | 
			
		||||
        reference: {},
 | 
			
		||||
@@ -576,6 +588,7 @@ function loadBomTable(table, options) {
 | 
			
		||||
            constructForm(`/api/bom/${pk}/`, {
 | 
			
		||||
                fields: fields,
 | 
			
		||||
                title: '{% trans "Edit BOM Item" %}',
 | 
			
		||||
                focus: 'sub_part',
 | 
			
		||||
                onSuccess: function() {
 | 
			
		||||
                    reloadBomTable(table);
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ function createNewModal(options={}) {
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    var html = `
 | 
			
		||||
    <div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}'>
 | 
			
		||||
    <div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}' tabindex='-1'>
 | 
			
		||||
        <div class='modal-dialog'>
 | 
			
		||||
            <div class='modal-content'>
 | 
			
		||||
                <div class="modal-header">
 | 
			
		||||
@@ -111,7 +111,7 @@ function createNewModal(options={}) {
 | 
			
		||||
 | 
			
		||||
    $(modal_name).modal({
 | 
			
		||||
        backdrop: 'static',
 | 
			
		||||
        keyboard: false,
 | 
			
		||||
        keyboard: user_settings.FORMS_CLOSE_USING_ESCAPE,
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // Set labels based on supplied options
 | 
			
		||||
@@ -681,7 +681,7 @@ function openModal(options) {
 | 
			
		||||
 | 
			
		||||
    $(modal).modal({
 | 
			
		||||
        backdrop: 'static',
 | 
			
		||||
        keyboard: false,
 | 
			
		||||
        keyboard: user_settings.FORMS_CLOSE_USING_ESCAPE,
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // Disable the form
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user