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

Commit acfb93b

Browse files
committed
Merge pull request #1421 from OpenBazaar/pr/1419
Pr/1419
2 parents f3243fa + 9d8c80f commit acfb93b

File tree

5 files changed

+61
-11
lines changed

5 files changed

+61
-11
lines changed

css/obBase.css

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,11 +2583,6 @@ div.chatSearchOut .chatSearchIcon {
25832583
border-top-right-radius: 0;
25842584
}
25852585

2586-
.btn.btn-back:before,
2587-
.btn.btn-fwd:before {
2588-
opacity: 0.3;
2589-
}
2590-
25912586
.btn.btn-back.active:before,
25922587
.btn.btn-fwd.active:before {
25932588
opacity: 1;
@@ -5872,7 +5867,31 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
58725867

58735868
#ov1.notFancy .notFancyDarkBackground,
58745869
#ov1.notFancy #obContainer .notFancyDarkBackground {
5875-
background: #262626;
5870+
background: #262626 !important;
5871+
}
5872+
5873+
#ov1.notFancy .disabled,
5874+
#ov1.notFancy #userPage .disabled,
5875+
#ov1.notFancy #obContainer .disabled,
5876+
#ov1.notFancy #overlay .disabled,
5877+
#ov1.notFancy #sideBar .disabled,
5878+
#ov1.notFancy #pageNav .disabled,
5879+
#ov1.notFancy #modalHolder .disabled,
5880+
#ov1.notFancy #messageModal .disabled,
5881+
#ov1.notFancy #statusBar .disabled {
5882+
opacity: 0.2 !important;
5883+
}
5884+
5885+
#ov1.notFancy .disabled2,
5886+
#ov1.notFancy #userPage .disabled2,
5887+
#ov1.notFancy #obContainer .disabled2,
5888+
#ov1.notFancy #overlay .disabled2,
5889+
#ov1.notFancy #sideBar .disabled2,
5890+
#ov1.notFancy #pageNav .disabled2,
5891+
#ov1.notFancy #modalHolder .disabled2,
5892+
#ov1.notFancy #messageModal .disabled2,
5893+
#ov1.notFancy #statusBar .disabled2 {
5894+
opacity: 0.7 !important;
58765895
}
58775896

58785897
/* add a shadow and a glow, so modal close buttons are still barely visible if the user picks a bad color */

js/router.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ module.exports = Backbone.Router.extend({
4848
this.navigate(translatedRoute, { trigger: true });
4949
});
5050
});
51+
history.size = -1;
52+
history.position = -1;
53+
history.action = 'default';
5154
},
5255

5356
translateRoute: function(route) {
@@ -103,6 +106,32 @@ module.exports = Backbone.Router.extend({
103106

104107
return deferred.promise();
105108
},
109+
110+
execute: function(callback, args, name) {
111+
if (history.action == 'default') {
112+
history.position += 1;
113+
history.size = history.position;
114+
} else if (history.action == 'back') {
115+
history.position -= 1;
116+
} else if(history.action == 'forward' && this.previousName != name && name != "index") {
117+
//don't increment if the same state is navigated to twice
118+
//don't increment on index since that isn't a real state
119+
history.position += 1;
120+
}
121+
history.action = 'default';
122+
123+
if (history.position == history.size)
124+
$('.js-navFwd').addClass('disabled');
125+
else
126+
$('.js-navFwd').removeClass('disabled');
127+
128+
if (history.position == 1)
129+
$('.js-navBack').addClass('disabled');
130+
else
131+
$('.js-navBack').removeClass('disabled');
132+
133+
if (callback) callback.apply(this, args);
134+
},
106135

107136
cleanup: function(){
108137
"use strict";

js/views/homeVw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ module.exports = baseVw.extend({
290290
this.searchItemsText = searchItemsText;
291291

292292
//add action to history
293-
Backbone.history.navigate("#home/" + state + "/" + searchItemsText.replace(/ /g, ""));
293+
Backbone.history.navigate("#home/" + state + "/" + searchItemsText.replace(/ /g, ""), { replace: true });
294294
} else {
295295
//add action to history
296-
Backbone.history.navigate("#home/" + state);
296+
Backbone.history.navigate("#home/" + state, { replace: true });
297297
}
298298

299299
this.state = state;

js/views/pageNavVw.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,13 @@ module.exports = baseVw.extend({
501501
},
502502

503503
navBackClick: function(){
504-
window.history.back();
504+
history.action = 'back';
505+
history.back();
505506
},
506507

507508
navFwdClick: function(){
508-
window.history.forward();
509+
history.action = 'forward';
510+
history.forward();
509511
},
510512

511513
navRefreshClick: function(){

js/views/settingsVw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ module.exports = Backbone.View.extend({
528528

529529
addTabToHistory: function(state){
530530
//add action to history
531-
Backbone.history.navigate("#settings/" + state);
531+
Backbone.history.navigate("#settings/" + state, { replace: true });
532532
this.options.state = state;
533533
},
534534

0 commit comments

Comments
 (0)