mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Requiring behaviour.js for TimeField, and using document.getElementById() instead of $ function alias in TimeField_dropdown.js
This commit is contained in:
parent
0a8a17833f
commit
3bd80dfb87
@ -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');
|
||||
|
||||
|
@ -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 );
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user