mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Avoid redundant initialisation of TypedInput type
This commit is contained in:
parent
3e0f080ea7
commit
fba6e801fc
@ -556,7 +556,7 @@
|
||||
this.optionExpandButton = $('<button tabindex="0" class="red-ui-typedInput-option-expand" style="display:inline-block"></button>').appendTo(this.uiSelect);
|
||||
this.optionExpandButtonIcon = $('<i class="red-ui-typedInput-icon fa fa-ellipsis-h"></i>').appendTo(this.optionExpandButton);
|
||||
|
||||
this.type(this.options.default||this.typeList[0].value);
|
||||
this.type(this.typeField.val() || this.options.default||this.typeList[0].value);
|
||||
this.typeChanged = !!this.options.default;
|
||||
}catch(err) {
|
||||
console.log(err.stack);
|
||||
@ -805,6 +805,7 @@
|
||||
var that = this;
|
||||
var currentType = this.type();
|
||||
this.typeMap = {};
|
||||
var firstCall = (this.typeList === undefined);
|
||||
this.typeList = types.map(function(opt) {
|
||||
var result;
|
||||
if (typeof opt === 'string') {
|
||||
@ -829,11 +830,15 @@
|
||||
}
|
||||
this.menu = this._createMenu(this.typeList,{},function(v) { that.type(v) });
|
||||
if (currentType && !this.typeMap.hasOwnProperty(currentType)) {
|
||||
if (!firstCall) {
|
||||
this.type(this.typeList[0].value);
|
||||
}
|
||||
} else {
|
||||
this.propertyType = null;
|
||||
if (!firstCall) {
|
||||
this.type(currentType);
|
||||
}
|
||||
}
|
||||
if (this.typeList.length === 1 && !this.typeList[0].icon && (!this.typeList[0].label || this.typeList[0].showLabel === false)) {
|
||||
this.selectTrigger.hide()
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user