BUG jQueryUI configs broken because keys were all lowercase

This commit is contained in:
Zauberfisch 2012-09-01 14:38:34 +00:00 committed by Ingo Schommer
parent 5d6e1f8bf1
commit d24ea5ec97
2 changed files with 5 additions and 3 deletions

View File

@ -133,10 +133,12 @@ class DateField extends TextField {
// 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 File

@ -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]) {