This repository was archived by the owner on May 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-7
lines changed
Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -2583,11 +2583,6 @@ div.chatSearchOut .chatSearchIcon {
25832583 bor der- to p- 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;
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ module.exports = Backbone.Router.extend({
4848 this . navigate ( translatedRoute , { trigger : true } ) ;
4949 } ) ;
5050 } ) ;
51+
52+ history . size = - 1 ;
53+ history . position = - 1 ;
54+ history . action = 'default' ;
5155 } ,
5256
5357 translateRoute : function ( route ) {
@@ -103,6 +107,30 @@ module.exports = Backbone.Router.extend({
103107
104108 return deferred . promise ( ) ;
105109 } ,
110+
111+ execute : function ( callback , args ) {
112+ if ( history . action == 'default' ) {
113+ history . position += 1 ;
114+ history . size = history . position ;
115+ } else if ( history . action == 'back' ) {
116+ history . position -= 1 ;
117+ } else if ( history . action == 'forward' ) {
118+ history . position += 1 ;
119+ }
120+ history . action = 'default' ;
121+
122+ if ( history . position == history . size )
123+ $ ( '.js-navFwd' ) . addClass ( 'disabled' ) ;
124+ else
125+ $ ( '.js-navFwd' ) . removeClass ( 'disabled' ) ;
126+
127+ if ( history . position == 1 )
128+ $ ( '.js-navBack' ) . addClass ( 'disabled' ) ;
129+ else
130+ $ ( '.js-navBack' ) . removeClass ( 'disabled' ) ;
131+
132+ if ( callback ) callback . apply ( this , args ) ;
133+ } ,
106134
107135 cleanup : function ( ) {
108136 "use strict" ;
Original file line number Diff line number Diff 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 ( ) {
You can’t perform that action at this time.
0 commit comments