Adam Shaw před 9 roky
rodič
revize
749420859e
3 změnil soubory, kde provedl 11 přidání a 4 odebrání
  1. 1 1
      src/Calendar.js
  2. 9 2
      src/common/Promise.js
  3. 1 1
      src/common/View.js

+ 1 - 1
src/Calendar.js

@@ -666,7 +666,7 @@ function Calendar_constructor(element, overrides) {
 						currentView.captureInitialScroll(forcedScroll);
 					}
 
-					currentView.setDate(date, forcedScroll); // will call freezeContentHeight
+					currentView.setDate(date, forcedScroll);
 
 					if (forcedScroll) {
 						currentView.releaseScroll();

+ 9 - 2
src/common/Promise.js

@@ -1,5 +1,12 @@
 
-// TODO: write comments and tests
+/*
+Wrap jQuery's Deferred Promise object to be slightly more Promise/A+ compliant.
+With the added non-standard feature of synchronously executing handlers on resolved promises,
+which doesn't always happen otherwise (esp with nested .then handlers!?),
+so, this makes things a lot easier, esp because jQuery 3 changed the synchronicity for Deferred objects.
+
+TODO: write tests and more comments
+*/
 
 function Promise(executor) {
 	var deferred = $.Deferred();
@@ -41,7 +48,7 @@ function Promise(executor) {
 		};
 	}
 
-	return promise;
+	return promise; // instanceof Promise will break :( TODO: make Promise a real class
 }
 
 FC.Promise = Promise;

+ 1 - 1
src/common/View.js

@@ -726,7 +726,7 @@ var View = FC.View = Class.extend(EmitterMixin, ListenerMixin, {
 
 
 	captureInitialScroll: function(forcedScroll) {
-		if (this.captureScroll()) {
+		if (this.captureScroll()) { // root?
 			this.capturedScroll.isInitial = true;
 
 			if (forcedScroll) {