Merge "Remove primary link from the bundle of page linked notification"

This commit is contained in:
jenkins-bot 2016-09-19 22:59:15 +00:00 committed by Gerrit Code Review
commit 92c7c8d521
2 changed files with 14 additions and 4 deletions

View file

@ -22,10 +22,14 @@ class EchoPageLinkedPresentationModel extends EchoEventPresentationModel {
}
public function getPrimaryLink() {
return array(
'url' => $this->getPageFrom()->getFullURL(),
'label' => $this->msg( 'notification-link-text-view-page' )->text(),
);
if ( $this->isBundled() ) {
return false;
} else {
return array(
'url' => $this->getPageFrom()->getFullURL(),
'label' => $this->msg( 'notification-link-text-view-page' )->text(),
);
}
}
public function getSecondaryLinks() {

View file

@ -69,6 +69,12 @@
// Events
this.toggleExpandButton.connect( this, { click: 'expand' } );
if ( !this.model.getPrimaryUrl() ) {
// If there's no primary link, make sure a click
// triggers the 'expand' action
this.$content.on( 'click', this.expand.bind( this ) );
}
// Initialization
this.populateFromModel();
this.toggleExpanded( false );