mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixed issue with cms help toggles not functioning correctly
This commit is contained in:
parent
29de6431fd
commit
b3e40dd0c3
@ -841,16 +841,26 @@ jQuery.noConflict();
|
|||||||
* in the href attribute (which doubles as an anchor link to that element).
|
* in the href attribute (which doubles as an anchor link to that element).
|
||||||
*/
|
*/
|
||||||
$('.cms .cms-help-toggle').entwine({
|
$('.cms .cms-help-toggle').entwine({
|
||||||
|
ToggleElement: null,
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
$(this.attr('href')).hide();
|
var id=this.attr('href');
|
||||||
|
if(id.indexOf('#')!=0) {
|
||||||
|
id=id.split('#');
|
||||||
|
id='#'+id[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
var element = jQuery(id);
|
||||||
|
$(this).setToggleElement(element);
|
||||||
|
element.hide();
|
||||||
},
|
},
|
||||||
onunmatch: function() {
|
onunmatch: function() {
|
||||||
this._super();
|
this._super();
|
||||||
|
$(this).setToggleElement(null);
|
||||||
},
|
},
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
$(this.attr('href')).toggle();
|
$(this).getToggleElement().toggle();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user