Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

API CHANGE Replace jQuery.metadata in DateField markup with HTML5 dat…

…a attributes
  • Loading branch information...
commit a196135089694eca883bde9b7ba48eea5b68e438 1 parent ac56fef
@chillu chillu authored
Showing with 3 additions and 4 deletions.
  1. +1 −2  forms/DateField.php
  2. +2 −2 javascript/DateField.js
View
3  forms/DateField.php
@@ -136,7 +136,7 @@ function Field() {
}
$config = array_filter($config);
- $this->addExtraClass(Convert::raw2json($config));
+ foreach($config as $k => $v) $this->setAttribute('data-' . $k, $v);
// Three separate fields for day, month and year
if($this->getConfig('dmyfields')) {
@@ -615,7 +615,6 @@ function onAfterRender($html) {
));
}
- Requirements::javascript(THIRDPARTY_DIR . "/jquery-metadata/jquery.metadata.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/DateField.js");
}
View
4 javascript/DateField.js
@@ -5,10 +5,10 @@
return $(this).each(function() {
if($(this).data('datepicker')) return; // already applied
- 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'),
- config = $.extend(opts || {}, $(this).metadata({type: 'class'}), {});
+ config = $.extend(opts || {}, $(this).data(), {});
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.