File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -113,20 +113,22 @@ var View = /** @class */ (function () {
113
113
}
114
114
} ;
115
115
View . prototype . setSlow = function ( ) {
116
- manager . delayTime = 1500 ;
116
+ manager . delayTime = 2000 ;
117
117
this . restartManager ( ) ;
118
118
} ;
119
119
View . prototype . setMedium = function ( ) {
120
- manager . delayTime = 1000 ;
120
+ manager . delayTime = 1200 ;
121
121
this . restartManager ( ) ;
122
122
} ;
123
123
View . prototype . setFast = function ( ) {
124
124
manager . delayTime = 600 ;
125
125
this . restartManager ( ) ;
126
126
} ;
127
127
View . prototype . restartManager = function ( ) {
128
- manager . pause ( ) ;
129
- manager . start ( ) ;
128
+ if ( this . playing ) {
129
+ manager . pause ( ) ;
130
+ manager . start ( ) ;
131
+ }
130
132
} ;
131
133
View . prototype . switchAlgorithm = function ( algo ) {
132
134
$ ( "#sortArray" ) . hide ( ) ;
Original file line number Diff line number Diff line change @@ -131,12 +131,12 @@ class View {
131
131
}
132
132
133
133
setSlow ( ) {
134
- manager . delayTime = 1500 ;
134
+ manager . delayTime = 2000 ;
135
135
this . restartManager ( ) ;
136
136
}
137
137
138
138
setMedium ( ) {
139
- manager . delayTime = 1000 ;
139
+ manager . delayTime = 1200 ;
140
140
this . restartManager ( ) ;
141
141
}
142
142
@@ -146,8 +146,10 @@ class View {
146
146
}
147
147
148
148
restartManager ( ) {
149
- manager . pause ( ) ;
150
- manager . start ( ) ;
149
+ if ( this . playing ) {
150
+ manager . pause ( ) ;
151
+ manager . start ( ) ;
152
+ }
151
153
}
152
154
153
155
switchAlgorithm ( algo : string ) {
You can’t perform that action at this time.
0 commit comments