mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-01 05:39:10 +02:00
No longer caching the target element to be toggled
This commit is contained in:
parent
b3e40dd0c3
commit
e954c8c1d1
@ -841,7 +841,6 @@ jQuery.noConflict();
|
||||
* in the href attribute (which doubles as an anchor link to that element).
|
||||
*/
|
||||
$('.cms .cms-help-toggle').entwine({
|
||||
ToggleElement: null,
|
||||
onmatch: function() {
|
||||
this._super();
|
||||
|
||||
@ -851,16 +850,19 @@ jQuery.noConflict();
|
||||
id='#'+id[1];
|
||||
}
|
||||
|
||||
var element = jQuery(id);
|
||||
$(this).setToggleElement(element);
|
||||
element.hide();
|
||||
jQuery(id).hide();
|
||||
},
|
||||
onunmatch: function() {
|
||||
this._super();
|
||||
$(this).setToggleElement(null);
|
||||
},
|
||||
onclick: function(e) {
|
||||
$(this).getToggleElement().toggle();
|
||||
var id=this.attr('href');
|
||||
if(id.indexOf('#')!=0) {
|
||||
id=id.split('#');
|
||||
id='#'+id[1];
|
||||
}
|
||||
|
||||
jQuery(id).toggle();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user