Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #5 from yohsuzuki/b1dc5f184c8f55843f3b79c5e418d6b0…

…b581ff98

Wrapped DOM manipulation code in a setTimeout in the refresh function to fix month/year switching slowness on phones.
  • Loading branch information...
commit 4928a8b41a87846bbbdad63001ba0623ccdacd30 2 parents b0f9498 + b1dc5f1
Di Peng authored March 22, 2012

Showing 1 changed file with 8 additions and 9 deletions. Show diff stats Hide diff stats

  1. 17  DatePicker.js
17  DatePicker.js
@@ -83,15 +83,14 @@ Ext.define('Ext.ux.DatePicker', {
83 83
     this.refresh();
84 84
   },
85 85
 
86  
-  refresh: function() {
87  
-    var me = this;
88  
-		var d = me.getValue() || new Date();
89  
-		me.element.setHtml(me.generateCalendar(d.getMonth(), d.getFullYear()));
90  
-
91  
-		me.setToday();
92  
-		if (me.getValue()) {
93  
-			me.setSelected(me.getValue());
94  
-		}
  86
+	refresh : function() {
  87
+		var me = this;
  88
+		setTimeout(function() {
  89
+			var v = me.getValue(), d = v || new Date();
  90
+			me.element.setHtml(me.generateCalendar(d.getMonth(), d.getFullYear()));
  91
+			me.setToday();
  92
+			v && me.setSelected(v);
  93
+		}, 0);
95 94
 	},
96 95
 	
97 96
 	generateCalendar: function(month, year) {

0 notes on commit 4928a8b

Please sign in to comment.
Something went wrong with that request. Please try again.