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:
Julian Seidenberg 2012-04-10 18:16:03 +12:00
parent 6671ae7ee9
commit 1e0b843353
2 changed files with 4 additions and 4 deletions

View File

@ -332,11 +332,11 @@ jQuery.noConflict();
* "opt in" to panel loading, while by default links still exhibit their default behaviour. * "opt in" to panel loading, while by default links still exhibit their default behaviour.
* Same goes for breadcrumbs in the CMS. * Same goes for breadcrumbs in the CMS.
*/ */
$('.cms .cms-panel-link, .cms a.crumb').entwine({ $('.cms .cms-panel-link').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('targetPanel')) ? {selector: this.data('targetPanel')} : null; data = (this.data('targetPanel')) ? {selector: this.data('targetPanel')} : null;
$('.cms-container').loadPanel(url, null, data); $('.cms-container').loadPanel(url, null, data);
e.preventDefault(); e.preventDefault();
} }

View File

@ -1,7 +1,7 @@
<% control Breadcrumbs %> <% control Breadcrumbs %>
<% if Last %> <% if Last %>
<span class="crumb">$Title.XML</span> <span class="cms-panel-link crumb">$Title.XML</span>
<% else %> <% else %>
<a class="crumb" href="$Link">$Title.XML</a> / <a class="cms-panel-link crumb" href="$Link">$Title.XML</a> /
<% end_if %> <% end_if %>
<% end_control %> <% end_control %>