Sfoglia il codice sorgente

UI: Added Panel.clear()

Mr.doob 12 anni fa
parent
commit
321b685f4a
1 ha cambiato i file con 10 aggiunte e 0 eliminazioni
  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
 // Text
 
 
 UI.Text = function ( text ) {
 UI.Text = function ( text ) {

粤ICP备19079148号