MINOR Load breadcrumb links via ajax into panels in CMS

This commit is contained in:
Ingo Schommer 2012-02-21 21:35:41 +01:00
parent abedf2a4a9
commit 39dc5ae301

View File

@ -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);