File tree Expand file tree Collapse file tree 5 files changed +6
-9
lines changed Expand file tree Collapse file tree 5 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,11 @@ img.bracket {
73
73
}
74
74
75
75
img # leftBracket {
76
- left : 20 px ;
76
+ left : 150 px ;
77
77
}
78
78
79
79
img # rightBracket {
80
- left : 1110 px ;
80
+ left : 980 px ;
81
81
}
82
82
83
83
img # paused {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ var n = 10;
11
11
* Check if an algorithm is already running - if that is the case reset the view
12
12
*/
13
13
function checkIfAlreadyRunning ( ) {
14
+ k . hide ( ) ;
14
15
var arr = setRandomArray ( ) ;
15
16
setArray ( viewer . serializeArray ( arr ) ) ;
16
17
manager . clear ( ) ;
@@ -21,7 +22,6 @@ function checkIfAlreadyRunning() {
21
22
*/
22
23
function startInsertionSort ( ) {
23
24
checkIfAlreadyRunning ( ) ;
24
- viewer . setPause ( ) ;
25
25
control . hideK ( ) ;
26
26
control . setHeadText ( "Insertion Sort" ) ;
27
27
var j ; // Elements sorted, starting on second position
@@ -45,7 +45,6 @@ function startInsertionSort() {
45
45
control . setJElement ( i + 1 , false ) ;
46
46
control . setElementBeingComparedTo ( j - 1 , false ) ;
47
47
}
48
- manager . start ( ) ;
49
48
}
50
49
function startShellSort ( ) {
51
50
checkIfAlreadyRunning ( ) ;
@@ -79,7 +78,6 @@ function startShellSort() {
79
78
control . setKValue ( k ) ;
80
79
}
81
80
control . hideK ( ) ;
82
- manager . start ( ) ;
83
81
}
84
82
/**
85
83
* Fill the array with random integers
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const n = 10;
14
14
* Check if an algorithm is already running - if that is the case reset the view
15
15
*/
16
16
function checkIfAlreadyRunning ( ) {
17
-
17
+ k . hide ( ) ;
18
18
let arr = setRandomArray ( ) ;
19
19
setArray ( viewer . serializeArray ( arr ) ) ;
20
20
manager . clear ( ) ;
@@ -26,7 +26,6 @@ function checkIfAlreadyRunning() {
26
26
*/
27
27
function startInsertionSort ( ) {
28
28
checkIfAlreadyRunning ( ) ;
29
- viewer . setPause ( ) ;
30
29
control . hideK ( ) ;
31
30
control . setHeadText ( "Insertion Sort" ) ;
32
31
let j : number ; // Elements sorted, starting on second position
@@ -50,7 +49,6 @@ function startInsertionSort() {
50
49
control . setJElement ( i + 1 , false ) ;
51
50
control . setElementBeingComparedTo ( j - 1 , false ) ;
52
51
}
53
- manager . start ( ) ;
54
52
}
55
53
56
54
function startShellSort ( ) {
@@ -91,7 +89,6 @@ function startShellSort() {
91
89
control . setKValue ( k ) ;
92
90
}
93
91
control . hideK ( ) ;
94
- manager . start ( )
95
92
}
96
93
97
94
/**
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ function setArray(serializedArray) {
7
7
$ ( "#arrayUl li, #indices p" ) . each ( function ( ) {
8
8
$ ( this ) . remove ( ) ;
9
9
} ) ;
10
+ $ ( "#arrayUl" ) . remove ( ) ;
10
11
// Insert new elements
11
12
array = serializedArray . split ( '|' ) ; // Deserialize array
12
13
$ ( "#array" ) . append ( "<ul id='arrayUl' class='insElements'></ul>" ) ; // TODO: this adds arrayUl without deleting it
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ function setArray(serializedArray: any) {
8
8
$ ( "#arrayUl li, #indices p" ) . each ( function ( ) {
9
9
$ ( this ) . remove ( ) ;
10
10
} ) ;
11
+ $ ( "#arrayUl" ) . remove ( ) ;
11
12
// Insert new elements
12
13
array = serializedArray . split ( '|' ) ; // Deserialize array
13
14
$ ( "#array" ) . append ( "<ul id='arrayUl' class='insElements'></ul>" ) ; // TODO: this adds arrayUl without deleting it
You can’t perform that action at this time.
0 commit comments