From 7ca153abd0840fd846321d129eab4cd9de80822b Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Wed, 4 Jul 2018 20:50:33 +0900 Subject: [PATCH] fix error on typedInput initialization --- editor/js/ui/common/typedInput.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/editor/js/ui/common/typedInput.js b/editor/js/ui/common/typedInput.js index 0f9e2a0d9..81b3a8d6e 100644 --- a/editor/js/ui/common/typedInput.js +++ b/editor/js/ui/common/typedInput.js @@ -467,7 +467,9 @@ var opt = this.typeMap[type]; if (opt && this.propertyType !== type) { this.propertyType = type; - this.typeField.val(type); + if (this.typeField) { + this.typeField.val(type); + } this.selectLabel.empty(); var image; if (opt.icon) { @@ -574,15 +576,17 @@ } this.elementDiv.show(); } - if (opt.expand && typeof opt.expand === 'function') { - this.optionExpandButton.show(); - this.optionExpandButton.off('click'); - this.optionExpandButton.on('click',function(evt) { - evt.preventDefault(); - opt.expand.call(that); - }) - } else { - this.optionExpandButton.hide(); + if (this.optionExpandButton) { + if (opt.expand && typeof opt.expand === 'function') { + this.optionExpandButton.show(); + this.optionExpandButton.off('click'); + this.optionExpandButton.on('click',function(evt) { + evt.preventDefault(); + opt.expand.call(that); + }) + } else { + this.optionExpandButton.hide(); + } } this.input.trigger('change',this.propertyType,this.value()); }