Selaa lähdekoodia

UI: Added Panel.clear()

Mr.doob 11 vuotta sitten
vanhempi
commit
321b685f4a
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  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 ) {