mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT: refactoring code for making a link an ajax/history link. Removing the selector that targets .crumb and only applying the selector that turns links with cms-panel-link into ajax enabled links. Adding the cms-panel-link to those links that already have the crumb class.
This commit is contained in:
parent
6671ae7ee9
commit
1e0b843353
@ -332,11 +332,11 @@ jQuery.noConflict();
|
||||
* "opt in" to panel loading, while by default links still exhibit their default behaviour.
|
||||
* Same goes for breadcrumbs in the CMS.
|
||||
*/
|
||||
$('.cms .cms-panel-link, .cms a.crumb').entwine({
|
||||
$('.cms .cms-panel-link').entwine({
|
||||
onclick: function(e) {
|
||||
var href = this.attr('href'), url = href ? href : this.data('href'),
|
||||
data = (this.data('targetPanel')) ? {selector: this.data('targetPanel')} : null;
|
||||
|
||||
|
||||
$('.cms-container').loadPanel(url, null, data);
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<% control Breadcrumbs %>
|
||||
<% if Last %>
|
||||
<span class="crumb">$Title.XML</span>
|
||||
<span class="cms-panel-link crumb">$Title.XML</span>
|
||||
<% else %>
|
||||
<a class="crumb" href="$Link">$Title.XML</a> /
|
||||
<a class="cms-panel-link crumb" href="$Link">$Title.XML</a> /
|
||||
<% end_if %>
|
||||
<% end_control %>
|
Loading…
x
Reference in New Issue
Block a user