mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-04 23:28:41 +02:00
MINOR Load breadcrumb links via ajax into panels in CMS
This commit is contained in:
parent
abedf2a4a9
commit
39dc5ae301
@ -296,9 +296,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads
|
* Loads the link's 'href' attribute into a panel via ajax,
|
||||||
|
* as opposed to triggering a full page reload.
|
||||||
|
* Little helper to avoid repetition, and make it easy to
|
||||||
|
* "opt in" to panel loading, while by default links still exhibit their default behaviour.
|
||||||
|
* Same goes for breadcrumbs in the CMS.
|
||||||
*/
|
*/
|
||||||
$('.cms-content .cms-panel-link').entwine({
|
$('.cms-content .cms-panel-link, .cms-content a.crumb').entwine({
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var href = this.attr('href'), url = href ? href : this.data('href'),
|
var href = this.attr('href'), url = href ? href : this.data('href'),
|
||||||
data = (this.data('target-panel')) ? {selector: this.data('target-panel')} : null;
|
data = (this.data('target-panel')) ? {selector: this.data('target-panel')} : null;
|
||||||
@ -307,5 +311,5 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
Loading…
Reference in New Issue
Block a user