Add ability for a panel link to link externally.

This commit is contained in:
Will Rossiter 2013-12-21 16:58:16 +13:00
parent 770e23f8e1
commit 3e2cf27b38
2 changed files with 7 additions and 0 deletions

View File

@ -842,6 +842,12 @@ jQuery.noConflict();
*/ */
$('.cms .cms-panel-link').entwine({ $('.cms .cms-panel-link').entwine({
onclick: function(e) { onclick: function(e) {
if($(this).hasClass('external-link')) {
e.stopPropagation();
return;
}
var href = this.attr('href'), var href = this.attr('href'),
url = (href && !href.match(/^#/)) ? href : this.data('href'), url = (href && !href.match(/^#/)) ? href : this.data('href'),
data = {pjax: this.data('pjaxTarget')}; data = {pjax: this.data('pjaxTarget')};

View File

@ -380,6 +380,7 @@ To avoid repetition, we've written some helpers for various use cases:
* Load into a PJAX panel: `<a href="..." class="cms-panel-link" data-pjax-target="Content">` * Load into a PJAX panel: `<a href="..." class="cms-panel-link" data-pjax-target="Content">`
* Load URL as an iframe into a popup/dialog: `<a href="..." class="ss-ui-dialog-link">` * Load URL as an iframe into a popup/dialog: `<a href="..." class="ss-ui-dialog-link">`
* GridField click to redirect to external link: `<a href="..." class="cms-panel-link action external-link">
## Buttons ## Buttons