Prechádzať zdrojové kódy

dont do updateSize when no handlers

Adam Shaw 8 rokov pred
rodič
commit
827e86ee1e
1 zmenil súbory, kde vykonal 14 pridanie a 10 odobranie
  1. 14 10
      src/View.js

+ 14 - 10
src/View.js

@@ -260,20 +260,24 @@ var View = FC.View = InteractiveDateComponent.extend({
 
 
 
 
 	onAllDateRender: function() {
 	onAllDateRender: function() {
-		this.applyScreenState(); // TODO: only call if hasHandlers
-		this.publiclyTrigger('viewRender', {
-			context: this,
-			args: [ this, this.el ]
-		});
+		if (this.hasPublicHandlers('viewRender')) {
+			this.applyScreenState();
+			this.publiclyTrigger('viewRender', {
+				context: this,
+				args: [ this, this.el ]
+			});
+		}
 	},
 	},
 
 
 
 
 	onBeforeAllDateUnrender: function() {
 	onBeforeAllDateUnrender: function() {
-		this.applyScreenState(); // TODO: only call if hasHandlers
-		this.publiclyTrigger('viewDestroy', {
-			context: this,
-			args: [ this, this.el ]
-		});
+		if (this.hasPublicHandlers('viewDestroy')) {
+			this.applyScreenState(); // TODO: only call if hasHandlers!
+			this.publiclyTrigger('viewDestroy', {
+				context: this,
+				args: [ this, this.el ]
+			});
+		}
 	},
 	},