Răsfoiți Sursa

DateComponent::removeChild/removeChildren

Adam Shaw 8 ani în urmă
părinte
comite
b96362d7d7
1 a modificat fișierele cu 19 adăugiri și 0 ștergeri
  1. 19 0
      src/component/DateComponent.js

+ 19 - 0
src/component/DateComponent.js

@@ -62,6 +62,25 @@ var DateComponent = FC.DateComponent = Component.extend({
 	},
 
 
+	removeChild: function(child) {
+		removeExact(this.children, child); // TODO: use a hash somehow!
+
+		this.dateMessageAggregator.removeChild(child);
+		this.eventMessageAggregator.removeChild(child);
+	},
+
+
+	removeChildren: function() { // all
+		var children = this.children;
+		var i;
+
+		// aggregators can only do one at a time
+		for (i = 0; i < children.length; i++) {
+			this.removeChild(children[i]);
+		}
+	},
+
+
 	requestRender: function(namespace, actionType, method, args) {
 		var _this = this;