Last active
March 30, 2020 20:15
-
-
Save barnabyalter/1f38846a8e0d768831640ab73acc7a94 to your computer and use it in GitHub Desktop.
Add custom alert bar to primo, populated by Back Office
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primo-explore-top-alert .bar.alert-bar { | |
font-size: 18px; | |
font-weight: 700; | |
border-color: #F89763; | |
background-color: #F89763 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.component('prmTopbarAfter', { | |
template: /*html*/ ` | |
<primo-explore-top-alert> | |
<div class="bar alert-bar" layout="row" layout-align="center center"> | |
<span class="bar-text"> | |
<span translate="custom.banner_value1"></span> | |
<a ng-href="{{ 'custom.banner_value2' | translate}}" target="_blank" class="arrow-link md-primoExplore-theme"> | |
<span>See more</span> | |
<span class="sr-only">(opens in a new window)</span> | |
<prm-icon external-link icon-type="svg" svg-icon-set="primo-ui" icon-definition="open-in-new"> | |
</prm-icon> | |
</a> | |
</span> | |
</div> | |
</primo-explore-top-alert>`, | |
controller: ['$element', function ($element) { | |
this.$postLink = function () { | |
const $primoExploreMain = $element.parent().parent().parent(); | |
const $el = $element.query(`primo-explore-top-alert`).detach(); | |
$primoExploreMain.prepend($el); | |
}; | |
}] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment