From 5b6e6200ea7bb68371f2f3884ca6e18a5c65fbc2 Mon Sep 17 00:00:00 2001 From: ihardy Date: Fri, 27 Jul 2018 11:51:28 -0400 Subject: [PATCH] add announcement module --- js/custom.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/js/custom.js b/js/custom.js index f2f9b4e..3797019 100755 --- a/js/custom.js +++ b/js/custom.js @@ -73,4 +73,47 @@ defaultTitle: '' }); + // WRLC announcement banner + angular + .module('wrlcAnnounce', ['ngAnimate']) + .component('prmSearchBarAfter', { + template: ` + +
+ + {{ $ctrl.message }} + {{ $ctrl.message }} + +
+
+ `, + controller: + function announceController(announceConfig, $http) { + + var self = this; + var config = announceConfig; + + // get show announcement + $http.get(config.announceAPI) + .then(function(response){ + // Test if we want to show the banner or not + if (config.getShow(response) == "TRUE") { + self.show = true; + } else { + self.show = false; + } + // get message and link using configured functions + self.message = config.getMessage(response); + self.link = config.getLink(response); + + }); + self.wrDismiss = function() { + self.dismissed = true; + } + } + + }); + })();