mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Split HTML manipulation to onadd, so elements are not accidentally duplicated
This commit is contained in:
parent
1bec8a5d0c
commit
86addea1d2
@ -47,13 +47,15 @@
|
|||||||
// XMLHttpRequest
|
// XMLHttpRequest
|
||||||
CurrentXhr: null,
|
CurrentXhr: null,
|
||||||
|
|
||||||
onmatch: function() {
|
onadd: function() {
|
||||||
this.append(
|
this.append(
|
||||||
'<span class="treedropdownfield-title"></span>' +
|
'<span class="treedropdownfield-title"></span>' +
|
||||||
'<div class="treedropdownfield-toggle-panel-link"><a href="#" class="ui-icon ui-icon-triangle-1-s"></a></div>' +
|
'<div class="treedropdownfield-toggle-panel-link"><a href="#" class="ui-icon ui-icon-triangle-1-s"></a></div>' +
|
||||||
'<div class="treedropdownfield-panel"><div class="tree-holder"></div></div>'
|
'<div class="treedropdownfield-panel"><div class="tree-holder"></div></div>'
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
onmatch: function() {
|
||||||
var linkTitle = strings.openLink;
|
var linkTitle = strings.openLink;
|
||||||
if(linkTitle) this.find("treedropdownfield-toggle-panel-link a").attr('title', linkTitle);
|
if(linkTitle) this.find("treedropdownfield-toggle-panel-link a").attr('title', linkTitle);
|
||||||
if(this.data('title')) this.setTitle(this.data('title'));
|
if(this.data('title')) this.setTitle(this.data('title'));
|
||||||
@ -334,7 +336,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('.TreeDropdownField.searchable').entwine({
|
$('.TreeDropdownField.searchable').entwine({
|
||||||
onmatch: function() {
|
onadd: function() {
|
||||||
this._super();
|
this._super();
|
||||||
var title = ss.i18n._t('TreeDropdownField.ENTERTOSEARCH');
|
var title = ss.i18n._t('TreeDropdownField.ENTERTOSEARCH');
|
||||||
this.find('.treedropdownfield-panel').prepend(
|
this.find('.treedropdownfield-panel').prepend(
|
||||||
|
Loading…
Reference in New Issue
Block a user