瀏覽代碼

modified killing behavior

Adam Shaw 8 年之前
父節點
當前提交
7e098f13b3
共有 3 個文件被更改,包括 6 次插入24 次删除
  1. 4 12
      src/Calendar.render.js
  2. 0 12
      src/common/RenderQueue.js
  3. 2 0
      src/component/DateComponent.js

+ 4 - 12
src/Calendar.render.js

@@ -101,9 +101,6 @@ Calendar.mixin({
 			this.clearView();
 		}
 
-		this.renderQueue.kill();
-		// ^ TODO: should we let all rendering play out?
-
 		this.toolbarsManager.proxyCall('removeElement');
 		this.contentEl.remove();
 		this.el.removeClass('fc fc-ltr fc-rtl');
@@ -210,7 +207,6 @@ Calendar.mixin({
 	// If not given a viewType, keep the current view but render different dates.
 	// Accepts an optional scroll state to restore to.
 	renderView: function(viewType) {
-		var _this = this;
 		var oldView = this.view;
 		var newView;
 
@@ -228,11 +224,9 @@ Calendar.mixin({
 
 			this.bindViewHandlers(newView);
 
-			this.renderQueue.queue(function() {
-				newView.setElement(
-					$("<div class='fc-view fc-" + viewType + "-view' />").appendTo(_this.contentEl)
-				);
-			});
+			newView.setElement(
+				$("<div class='fc-view fc-" + viewType + "-view' />").appendTo(this.contentEl)
+			);
 
 			this.toolbarsManager.proxyCall('activateButton', viewType);
 		}
@@ -254,9 +248,7 @@ Calendar.mixin({
 
 		this.unbindViewHandlers(currentView);
 
-		this.renderQueue.queue(function() {
-			currentView.removeElement();
-		});
+		currentView.removeElement();
 
 		this.view = null;
 	},

+ 0 - 12
src/common/RenderQueue.js

@@ -53,18 +53,6 @@ var RenderQueue = TaskQueue.extend({
 	},
 
 
-	/*
-	Prevents any new tasks from being added AND clears all tasks related to rendering *new* things,
-	however, keeps destroy-related tasks to allow proper cleanup.
-	*/
-	kill: function() {
-		this.isKilled = true;
-		this.q = this.q.filter(function(task) {
-			return task.actionType === 'destroy';
-		});
-	},
-
-
 	startWait: function(namespace, waitMs) {
 		this.waitNamespace = namespace;
 		this.spawnWait(waitMs);

+ 2 - 0
src/component/DateComponent.js

@@ -132,6 +132,8 @@ var DateComponent = FC.DateComponent = Component.extend({
 	},
 
 
+	// TODO: only do if isInDom?
+	// TODO: make part of Component, along with children/batch-render system?
 	updateSize: function(totalHeight, isAuto, isResize) {
 		this.callChildren('updateSize', arguments);
 	},