Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG jQueryUI configs broken because keys were all lowercase

  • Loading branch information...
commit d24ea5ec97ff559406c7f8f49f13e1e0332b9a75 1 parent 5d6e1f8
@Zauberfisch Zauberfisch authored chillu committed
Showing with 5 additions and 3 deletions.
  1. +4 −2 forms/DateField.php
  2. +1 −1  javascript/DateField.js
View
6 forms/DateField.php
@@ -133,10 +133,12 @@ function Field($properties = array()) {
// Add other jQuery UI specific, namespaced options (only serializable, no callbacks etc.)
// TODO Move to DateField_View_jQuery once we have a properly extensible HTML5 attribute system for FormField
+ $jqueryUIConfig = array();
foreach($this->getConfig() as $k => $v) {
- if(preg_match('/^jQueryUI\.(.*)/', $k, $matches)) $config[$matches[1]] = $v;
+ if(preg_match('/^jQueryUI\.(.*)/', $k, $matches)) $jqueryUIConfig[$matches[1]] = $v;
}
-
+ if ($jqueryUIConfig)
+ $config['jqueryuiconfig'] = Convert::array2json(array_filter($jqueryUIConfig));
$config = array_filter($config);
foreach($config as $k => $v) $this->setAttribute('data-' . $k, $v);
View
2  javascript/DateField.js
@@ -8,7 +8,7 @@
$(this).siblings("button").addClass("ui-icon ui-icon-calendar");
var holder = $(this).parents('.field.date:first'),
- config = $.extend(opts || {}, $(this).data(), {});
+ config = $.extend(opts || {}, $(this).data(), $(this).data('jqueryuiconfig'), {});
if(!config.showcalendar) return;
if(config.locale && $.datepicker.regional[config.locale]) {
Please sign in to comment.
Something went wrong with that request. Please try again.