Skip to content
This repository
Browse code

BUG jQueryUI configs broken because keys were all lowercase

  • Loading branch information...
commit d24ea5ec97ff559406c7f8f49f13e1e0332b9a75 1 parent 5d6e1f8
authored September 01, 2012 chillu committed September 02, 2012
6  forms/DateField.php
@@ -133,10 +133,12 @@ function Field($properties = array()) {
133 133
 
134 134
 		// Add other jQuery UI specific, namespaced options (only serializable, no callbacks etc.)
135 135
 		// TODO Move to DateField_View_jQuery once we have a properly extensible HTML5 attribute system for FormField
  136
+		$jqueryUIConfig = array();
136 137
 		foreach($this->getConfig() as $k => $v) {
137  
-			if(preg_match('/^jQueryUI\.(.*)/', $k, $matches)) $config[$matches[1]] = $v;
  138
+			if(preg_match('/^jQueryUI\.(.*)/', $k, $matches)) $jqueryUIConfig[$matches[1]] = $v;
138 139
 		}
139  
-		
  140
+		if ($jqueryUIConfig)
  141
+			$config['jqueryuiconfig'] =  Convert::array2json(array_filter($jqueryUIConfig));
140 142
 		$config = array_filter($config);
141 143
 		foreach($config as $k => $v) $this->setAttribute('data-' . $k, $v);
142 144
 		
2  javascript/DateField.js
@@ -8,7 +8,7 @@
8 8
 				$(this).siblings("button").addClass("ui-icon ui-icon-calendar");
9 9
 				
10 10
 				var holder = $(this).parents('.field.date:first'), 
11  
-					config = $.extend(opts || {}, $(this).data(), {});
  11
+					config = $.extend(opts || {}, $(this).data(), $(this).data('jqueryuiconfig'), {});
12 12
 				if(!config.showcalendar) return;
13 13
 	
14 14
 				if(config.locale && $.datepicker.regional[config.locale]) {

0 notes on commit d24ea5e

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