Skip to content

Commit

Permalink
MINOR Load breadcrumb links via ajax into panels in CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Feb 23, 2012
1 parent abedf2a commit 39dc5ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions admin/javascript/LeftAndMain.Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
var href = this.attr('href'), url = href ? href : this.data('href'),
data = (this.data('target-panel')) ? {selector: this.data('target-panel')} : null;
Expand All @@ -307,5 +311,5 @@
e.preventDefault();
}
});

})(jQuery);

0 comments on commit 39dc5ae

Please sign in to comment.