mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG jQueryUI configs broken because keys were all lowercase
This commit is contained in:
parent
5d6e1f8bf1
commit
d24ea5ec97
@ -133,10 +133,12 @@ class DateField extends TextField {
|
|||||||
|
|
||||||
// Add other jQuery UI specific, namespaced options (only serializable, no callbacks etc.)
|
// 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
|
// 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) {
|
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);
|
$config = array_filter($config);
|
||||||
foreach($config as $k => $v) $this->setAttribute('data-' . $k, $v);
|
foreach($config as $k => $v) $this->setAttribute('data-' . $k, $v);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
$(this).siblings("button").addClass("ui-icon ui-icon-calendar");
|
$(this).siblings("button").addClass("ui-icon ui-icon-calendar");
|
||||||
|
|
||||||
var holder = $(this).parents('.field.date:first'),
|
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.showcalendar) return;
|
||||||
|
|
||||||
if(config.locale && $.datepicker.regional[config.locale]) {
|
if(config.locale && $.datepicker.regional[config.locale]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user