MINOR Requiring behaviour.js for TimeField, and using document.getElementById() instead of $ function alias in TimeField_dropdown.js

This commit is contained in:
Ingo Schommer 2011-08-16 16:59:42 +02:00
parent 0a8a17833f
commit 3bd80dfb87
2 changed files with 4 additions and 3 deletions

View File

@ -74,6 +74,7 @@ class TimeField extends TextField {
*/
protected function FieldDriver($html) {
if($this->getConfig('showdropdown')) {
Requirements::javascript(THIRDPARTY_DIR . '/behaviour/behaviour.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TimeField_dropdown.js');
Requirements::css(SAPPHIRE_DIR . '/css/TimeField_dropdown.css');

View File

@ -4,11 +4,11 @@ TimeBehaviour = {
initialise : function () {
this.isOpen = false;
this.icon = $( this.id + '-icon' );
this.icon = document.getElementById( this.id + '-icon' );
this.icon.onclick = this.toggle.bind( this );
this.dropdowntime = $( this.id + '-dropdowntime' );
this.dropdowntime = document.getElementById( this.id + '-dropdowntime' );
var dropdown =
'<select id="' + this.id + '-dropdowntime' + '-select' + '" size="18">' +
@ -59,7 +59,7 @@ TimeBehaviour = {
DropdownTime[ DropdownTime.length ] = this.dropdowntime;
this.selectTag = $( this.id + '-dropdowntime' + '-select' );
this.selectTag = document.getElementById( this.id + '-dropdowntime' + '-select' );
this.selectTag.onchange = this.updateValue.bind( this );
},