| 79 | |
| 80 | |
| 81 | function showSortSteps () { |
| 82 | var len = afterSortArray.length, |
| 83 | firstId, |
| 84 | secondId, |
| 85 | firstIdValue, |
| 86 | secondIdValue; |
| 87 | |
| 88 | setTimeout(function () { |
| 89 | |
| 90 | try { |
| 91 | firstId = afterSortArray[j].firstId; |
| 92 | } catch (e) { |
| 93 | document.body.className = 'shell-body'; |
| 94 | } |
| 95 | |
| 96 | secondId = afterSortArray[j].secondId; |
| 97 | |
| 98 | firstIdValue = firstId.value; |
| 99 | secondIdValue = secondId.value; |
| 100 | |
| 101 | document.body.className = ''; |
| 102 | firstId.setAttribute('class', 'animated zoomIn'); |
| 103 | secondId.setAttribute('class', 'animated zoomIn'); |
| 104 | |
| 105 | setTimeout(function () { |
| 106 | j++; |
| 107 | |
| 108 | firstId.value = secondIdValue; |
| 109 | secondId.value = firstIdValue; |
| 110 | }, 1000); |
| 111 | |
| 112 | if (j < len) { |
| 113 | setTimeout(function () { |
| 114 | firstId.removeAttribute('class'); |
| 115 | secondId.removeAttribute('class'); |
| 116 | }, 1000); |
| 117 | |
| 118 | showSortSteps(); |
| 119 | } |
| 120 | }, 3000); |
| 121 | } |
| 122 | |
| 123 | showSortSteps(); |
| 124 | }; |