* Shift the requested panel to the left one position swapping it with that panel to the left. * @param {number} panelIndex - Position of the panel in the array of panels on this post to shift left. * @return {number} The new index of the shifted panel.
(panelIndex)
| 76 | * @return {number} The new index of the shifted panel. |
| 77 | */ |
| 78 | shiftLeft(panelIndex) { |
| 79 | // If already at the far left end, return. |
| 80 | if (panelIndex <= 0) { |
| 81 | return panelIndex; |
| 82 | } |
| 83 | this.panels.splice(panelIndex - 1, 2, this.panels[panelIndex], this.panels[panelIndex - 1]); |
| 84 | return panelIndex - 1; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Shift the requested panel to the right one position swaping it with that panel to the right. |