| Index: client/view/SliderMenu.dart
|
| diff --git a/client/view/SliderMenu.dart b/client/view/SliderMenu.dart
|
| index 19f3eb8f311a96ab76fcb93de06b7ede7e80195d..c10cb2ffe6d6fa9f8245433bc10d65966cc352fb 100644
|
| --- a/client/view/SliderMenu.dart
|
| +++ b/client/view/SliderMenu.dart
|
| @@ -153,13 +153,19 @@ class SliderMenu extends View {
|
| * animate - if true, then animate the movement of the triangle slider
|
| */
|
| void updateIndicator(bool animate) {
|
| - num x = 0;
|
| if (selectedItem != null) {
|
| // calculate where we want to put the triangle
|
| - x = selectedItem.offsetLeft +
|
| - selectedItem.offsetWidth / 2 - TRIANGLE_WIDTH / 2;
|
| + selectedItem.rect.then((ElementRect rect) {
|
| + num x = rect.offset.left +
|
| + rect.offset.width / 2 - TRIANGLE_WIDTH / 2;
|
| + _moveIndicator(x, animate);
|
| + });
|
| + } else {
|
| + _moveIndicator(0, animate);
|
| }
|
| + }
|
|
|
| + void _moveIndicator(num x, bool animate) {
|
| // find the slider filler (the div element to the left of the
|
| // triangle) set its width the push the triangle to where we want it.
|
| String duration = animate ? '.3s' : '0s';
|
|
|