瀏覽代碼

UI: Added Panel.clear()

Mr.doob 11 年之前
父節點
當前提交
321b685f4a
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      editor/js/libs/ui.js

+ 10 - 0
editor/js/libs/ui.js

@@ -126,6 +126,16 @@ UI.Panel.prototype.remove = function () {
 
 };
 
+UI.Panel.prototype.clear = function () {
+
+	while ( this.dom.children.length ) {
+
+		this.dom.removeChild( this.dom.lastChild );
+
+	}
+
+};
+
 // Text
 
 UI.Text = function ( text ) {