Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 24e64ca

Browse files
committed
Only render the social sharing area if the localstorage showSocial is not hide.
1 parent e399dea commit 24e64ca

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

js/templates/pageNav.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ <h3 class="margin0 marginTop25"><%= polyglot.t('Discover') %></h3>
170170
</div>
171171
</div>
172172

173+
<% if (ob.showSocial) { %>
173174
<div class="socialReminder js-socialReminder">
174175
<% var shareURL = "https%3A%2F%2Fopenbazaar.org" %>
175176
<h3 class="socialTitle"><%= polyglot.t('socialSharing.reminder') %></h3>
@@ -192,3 +193,4 @@ <h3 class="socialTitle"><%= polyglot.t('socialSharing.reminder') %></h3>
192193
</a>
193194
</div>
194195
</div>
196+
<% } %>

js/views/pageNavVw.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ module.exports = baseVw.extend({
5757
this.languages = new languagesModel();
5858
this.showDiscIntro = options.showDiscIntro;
5959

60+
this.showSocial = localStorage.getItem('showSocial') !== 'hide';
61+
6062
this.listenTo(window.obEventBus, "updateProfile", function(){
6163
this.refreshProfile();
6264
});
@@ -332,7 +334,10 @@ module.exports = baseVw.extend({
332334
var connectedServer = app.serverConnectModal.getConnectedServer();
333335

334336
self.$el.html(loadedTemplate(
335-
__.extend(self.model.toJSON(), { connectedServer: connectedServer && connectedServer.toJSON() })
337+
__.extend(self.model.toJSON(), {
338+
connectedServer: connectedServer && connectedServer.toJSON(),
339+
showSocial: self.showSocial,
340+
})
336341
));
337342

338343
self.$notifMenu = self.$('.js-navNotificationsMenu');
@@ -378,7 +383,6 @@ module.exports = baseVw.extend({
378383
self.suggestionsVw = new SuggestionsVw({
379384
$input: self.$addressInput
380385
});
381-
self.$socialReminder = self.$('.js-socialReminder');
382386

383387
self.$('.js-mainSearchWrapper').append(self.suggestionsVw.render().el);
384388

@@ -403,7 +407,8 @@ module.exports = baseVw.extend({
403407
self.registerChild(self.aboutModal);
404408
}
405409

406-
if (localStorage.getItem('showSocial') !== 'hide') {
410+
if (self.showSocial) {
411+
self.$socialReminder = self.$('.js-socialReminder');
407412
setTimeout(function() {
408413
self.$socialReminder.addClass('show');
409414
}, 10000);

0 commit comments

Comments
 (0)