OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of swarmlib; | 5 part of swarmlib; |
6 | 6 |
7 // This file contains View framework classes. | 7 // This file contains View framework classes. |
8 // As it grows, it may need to be split into multiple files. | 8 // As it grows, it may need to be split into multiple files. |
9 | 9 |
10 /** A factory that creates a view from a data model. */ | 10 /** A factory that creates a view from a data model. */ |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 FxUtil.computeRelativePosition(view.node, _containerElem); | 524 FxUtil.computeRelativePosition(view.node, _containerElem); |
525 } | 525 } |
526 assert (_itemViews[index] is _PlaceholderView); | 526 assert (_itemViews[index] is _PlaceholderView); |
527 view.enterDocument(); | 527 view.enterDocument(); |
528 _itemViews[index].node.replaceWith(view.node); | 528 _itemViews[index].node.replaceWith(view.node); |
529 _itemViews[index] = view; | 529 _itemViews[index] = view; |
530 if (animate) { | 530 if (animate) { |
531 FxUtil.setTranslate(view.node, currentPosition.x, currentPosition.y, 0); | 531 FxUtil.setTranslate(view.node, currentPosition.x, currentPosition.y, 0); |
532 // The view's position is unchanged except now re-parented to | 532 // The view's position is unchanged except now re-parented to |
533 // the list view. | 533 // the list view. |
534 Timer.run(() { _positionSubview(view.node, index); }); | 534 window.setTimeout(() { _positionSubview(view.node, index); }, 0); |
535 } else { | 535 } else { |
536 _positionSubview(view.node, index); | 536 _positionSubview(view.node, index); |
537 } | 537 } |
538 } | 538 } |
539 | 539 |
540 int findIndex(D targetItem) { | 540 int findIndex(D targetItem) { |
541 // TODO(jacobr): move this to a util library or modify this class so that | 541 // TODO(jacobr): move this to a util library or modify this class so that |
542 // the data is an List not a Collection. | 542 // the data is an List not a Collection. |
543 int i = 0; | 543 int i = 0; |
544 for (D item in _data) { | 544 for (D item in _data) { |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 | 975 |
976 container = node.query('.dialog-body'); | 976 container = node.query('.dialog-body'); |
977 container.nodes.add(_content.node); | 977 container.nodes.add(_content.node); |
978 | 978 |
979 return node; | 979 return node; |
980 } | 980 } |
981 | 981 |
982 /** Override to handle dialog done. */ | 982 /** Override to handle dialog done. */ |
983 void onDone() { } | 983 void onDone() { } |
984 } | 984 } |
OLD | NEW |