mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG Adjust the tree construction and triggers to work with IE.
After Hamish's suggestion. Entwine onchange would not get executed in IE8 at all, which would have the effect of the displyed dropdown selection not being set. Change to onadd also mandates the changes to onadd on other parts of the tree component - otherwise the change event can trigger before the tree elements are added to the DOM.
This commit is contained in:
parent
7c41ff22ab
commit
c785f3c492
@ -29,7 +29,7 @@
|
||||
* @todo Expand title height to fit all elements
|
||||
*/
|
||||
$('.TreeDropdownField').entwine({
|
||||
onmatch: function() {
|
||||
onadd: function() {
|
||||
this.append(
|
||||
'<span class="treedropdownfield-title"></span>' +
|
||||
'<div class="treedropdownfield-toggle-panel-link"><a href="#" class="ui-icon ui-icon-triangle-1-s"></a></div>' +
|
||||
@ -43,9 +43,6 @@
|
||||
this.getPanel().hide();
|
||||
this._super();
|
||||
},
|
||||
onunmatch: function() {
|
||||
this._super();
|
||||
},
|
||||
getPanel: function() {
|
||||
return this.find('.treedropdownfield-panel');
|
||||
},
|
||||
@ -260,7 +257,7 @@
|
||||
});
|
||||
|
||||
$('.TreeDropdownField.searchable').entwine({
|
||||
onmatch: function() {
|
||||
onadd: function() {
|
||||
this._super();
|
||||
|
||||
var title = this.data('title');
|
||||
@ -270,9 +267,6 @@
|
||||
|
||||
this.setTitle(title ? title : strings.searchFieldTitle);
|
||||
},
|
||||
onunmatch: function() {
|
||||
this._super();
|
||||
},
|
||||
setTitle: function(title) {
|
||||
if(!title && title !== '') title = strings.fieldTitle;
|
||||
|
||||
@ -372,8 +366,13 @@
|
||||
});
|
||||
|
||||
$('.TreeDropdownField input[type=hidden]').entwine({
|
||||
onchange: function() {
|
||||
this.getField().updateTitle();
|
||||
onadd: function() {
|
||||
this.bind('change.TreeDropdownField', function() {
|
||||
$(this).getField().updateTitle();
|
||||
});
|
||||
},
|
||||
onremove: function() {
|
||||
this.unbind('.TreeDropdownField');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user