浏览代码

Editor: Fixed UI.Listbox bugs.

Mr.doob 5 年之前
父节点
当前提交
3b9016bf16
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      editor/js/libs/ui.js

+ 5 - 5
editor/js/libs/ui.js

@@ -1159,7 +1159,7 @@ UI.Listbox = function ( ) {
 };
 
 UI.Listbox.prototype = Object.create( UI.Element.prototype );
-UI.Listbox.prototype.constructor = UI.ListboxItem;
+UI.Listbox.prototype.constructor = UI.Listbox;
 
 UI.Listbox.prototype.setItems = function ( items ) {
 
@@ -1169,7 +1169,7 @@ UI.Listbox.prototype.setItems = function ( items ) {
 
 	}
 
-	this.render( );
+	this.render();
 
 };
 
@@ -1217,11 +1217,11 @@ UI.Listbox.prototype.selectIndex = function ( index ) {
 
 	}
 
-	this.selectIndex = index;
+	this.selectedIndex = index;
 
 };
 
-UI.Listbox.prototype.getValue = function ( index ) {
+UI.Listbox.prototype.getValue = function () {
 
 	return this.selectedValue;
 
@@ -1233,7 +1233,7 @@ UI.Listbox.prototype.setValue = function ( value ) {
 
 		var element = this.listitems[ i ];
 
-		if ( element.getId( ) === value ) {
+		if ( element.getId() === value ) {
 
 			element.addClass( 'active' );