New module 'Date'
This commit is contained in:
parent
a4887c6502
commit
ac4b84765b
116 changed files with 30150 additions and 0 deletions
33
sites/all/modules/date/date_popup/date_popup.js
Normal file
33
sites/all/modules/date/date_popup/date_popup.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
|
||||
/**
|
||||
* Attaches the calendar behavior to all required fields
|
||||
*/
|
||||
Drupal.behaviors.date_popup = function (context) {
|
||||
for (var id in Drupal.settings.datePopup) {
|
||||
$('#'+ id).bind('focus', Drupal.settings.datePopup[id], function(e) {
|
||||
if (!$(this).hasClass('date-popup-init')) {
|
||||
var datePopup = e.data;
|
||||
// Explicitely filter the methods we accept.
|
||||
switch (datePopup.func) {
|
||||
case 'datepicker':
|
||||
$(this)
|
||||
.datepicker(datePopup.settings)
|
||||
.addClass('date-popup-init')
|
||||
$(this).click(function() {
|
||||
$(this).focus();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'timeEntry':
|
||||
$(this)
|
||||
.timeEntry(datePopup.settings)
|
||||
.addClass('date-popup-init')
|
||||
$(this).click(function() {
|
||||
$(this).focus();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
Reference in a new issue