mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Remove TreeDropdownField placeholder support (see #2364)
It breaks the semantics of getValue(), leading to a broken field. Regression from 8b5f89f. In the end, placeholder support is considered "progressive enhancement", the search box should be pretty obvious to IE8/IE9 users either way, given the main field label is called "choose or search".
This commit is contained in:
parent
20b49e215c
commit
93ea066f53
@ -296,25 +296,10 @@
|
||||
cancelSearch: function() {
|
||||
this.closePanel();
|
||||
this.loadTree();
|
||||
},
|
||||
getValue: function(title){
|
||||
//Provide value for IE8 and 9 as they don't support placeholders
|
||||
return ($.browser.msie && parseInt($.browser.version, 10) <= 9) ? title:'';
|
||||
}
|
||||
});
|
||||
|
||||
$('.TreeDropdownField.searchable input.search').entwine({
|
||||
onfocusin: function(){
|
||||
//IE placeholder support
|
||||
this.val('');
|
||||
},
|
||||
onfocusout: function(){
|
||||
//IE placeholder support
|
||||
var value = this.closest('.TreeDropdownField').getValue(this.attr('placeholder'));
|
||||
if(this.val() === ''){
|
||||
this.val(value);
|
||||
}
|
||||
},
|
||||
onkeydown: function(e) {
|
||||
var field = this.getField();
|
||||
if(e.keyCode == 13) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user