Skip to content

Commit

Permalink
Merge pull request #608 from aholachek/alerts-2
Browse files Browse the repository at this point in the history
Alerts 2
  • Loading branch information
aholachek committed Oct 1, 2015
2 parents 022d2c2 + d84b361 commit 79f5efc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/js/components/query_mediator.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ define(['underscore',
*/
executeRequest: function(apiRequest, senderKey) {
if (!(apiRequest instanceof ApiRequest)) {
throw new Error('Sir, I belive you forgot to send me a valid ApiRequest!');
throw new Error('Sir or Madam, I believe you forgot to send me a valid ApiRequest!');
}
else if (!senderKey){
throw new Error("Request executed, but no widget id provided!");
Expand Down
14 changes: 3 additions & 11 deletions src/js/page_managers/templates/master-page-manager.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<div class="row" id="navbar-container">
<div data-widget="NavbarWidget"/>
</div>
<div>
<div data-widget="AlertsWidget"/>
</div>

<div class="dynamic-container s-dynamic-container">

</div>


<div>
<div data-widget="FooterWidget"/>
</div>
<div class="row" data-widget="AlertsWidget"/>
<div class="dynamic-container s-dynamic-container"> </div>
<div data-widget="FooterWidget"/>

<script>
//put script here that need to be run only once and registered
Expand Down
2 changes: 1 addition & 1 deletion src/js/widgets/alerts/templates/alerts_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h4 class="modal-title" id="alertBoxLabel">
{{else}}
<!-- Normal -->
{{#if msg}}
<div class="alert alert-{{type}} animated fadeInDown " id="alertBox">
<div class="alert alert-{{type}}" id="alertBox">
{{{msg}}}
<button type="button" class="close"><span aria-hidden="true"><i class="fa fa-2x fa-times"></i></span><span class="sr-only">Close</span></button>
</div>
Expand Down
12 changes: 4 additions & 8 deletions src/js/wraps/alerts_mediator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,19 @@ define([
activate: function(beehive, app) {
AlertsMediator.prototype.activate.apply(this, arguments);
var pubsub = this.getPubSub();
pubsub.subscribe(pubsub.APP_STARTED, _.bind(this.onAppStart, this));
pubsub.subscribe(pubsub.APP_STARTED, _.bind(this.displaySiteMessage, this));
pubsub.subscribe(pubsub.ARIA_ANNOUNCEMENT, _.bind(this.displaySiteMessage, this));
},

onAlert: function(apiFeedback, psk) {
this._dirty = true;
AlertsMediator.prototype.onAlert.call(this, arguments);
AlertsMediator.prototype.onAlert.apply(this, arguments);
},

onAppStart: function() {
displaySiteMessage : function() {
var self = this;
setTimeout(function() {
self.checkAndDisplaySiteMessage();
self.timerId = setInterval(function() {
self.checkAndDisplaySiteMessage();
}, 3600 * 1000);

}, 1000);
},

Expand Down Expand Up @@ -91,7 +88,6 @@ define([
}
}))
.done(function (v) {
debugger
if (v == 'dismissed') {
if (user && user.isLoggedIn())
user.setMyADSData({'last_seen_message': val});
Expand Down
2 changes: 1 addition & 1 deletion src/js/wraps/discovery_mediator.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ define([
app.getObject('AppStorage').setCurrentQuery(null);
}

app.getService('Navigator').navigate('results-page');
app.getService('Navigator').navigate('results-page');

if (feedback.request && feedback.request.get('target').indexOf('search') > -1 && feedback.query && !feedback.numFound) {
var q = feedback.query;
Expand Down
15 changes: 5 additions & 10 deletions src/styles/less/ads-less/any-page.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,22 @@


div[data-widget="AlertsWidget"] {
position: relative;

.s-alerts {
width:80%;
position: absolute;
left: 11%;
top: 5px;
z-index: @z-index-4;
opacity: .9;

.alert {
margin: 0 -15px 0 -15px;
margin-bottom: 0 !important;
border-radius: 0;
font-size: 18px;
border: 0px solid transparent !important;
padding: 25px;
padding-left: 45px;
}

button.close {
position: relative;
top: -11px;
left: 3px;
}
}
}

.s-tabs-widget {
Expand Down

0 comments on commit 79f5efc

Please sign in to comment.