Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Unified Diff: lib/components/carousel.dart

Issue 14295009: Fix widget.dart to work with the latest web_ui library. Specifically, query selectors need to use "… (Closed) Base URL: https://github.com/kevmoo/widget.dart.git@master
Patch Set: ptal Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/components/alert.html ('k') | lib/components/carousel.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/components/carousel.dart
diff --git a/lib/components/carousel.dart b/lib/components/carousel.dart
index c07a12b0595d19a796f4266f2bb7955705c2a396..bf31358013831090cc84e96ec47758b32050be95 100644
--- a/lib/components/carousel.dart
+++ b/lib/components/carousel.dart
@@ -25,20 +25,21 @@ class Carousel extends WebComponent {
Future<bool> previous() => _moveDelta(false);
- SwapComponent get _swap => this.query('x-carousel > .carousel > x-swap').xtag;
+ SwapComponent get _swap =>
+ this.query('[is=x-carousel] > .carousel > [is=x-swap]').xtag;
Future<bool> _moveDelta(bool doNext) {
final swap = _swap;
assert(swap != null);
- if(swap.items.length == 0) {
- return new Future.immediate(false);
+ if (swap.items.length == 0) {
+ return new Future.value(false);
}
assert(doNext != null);
final delta = doNext ? 1 : -1;
ShowHideEffect showEffect, hideEffect;
- if(doNext) {
+ if (doNext) {
showEffect = _fromTheRight;
hideEffect = _fromTheLeft;
} else {
@@ -50,6 +51,7 @@ class Carousel extends WebComponent {
final newIndex = (activeIndex + delta) % _swap.items.length;
- return _swap.showItemAtIndex(newIndex, effect: showEffect, hideEffect: hideEffect, duration: _duration);
+ return _swap.showItemAtIndex(newIndex, effect: showEffect,
+ hideEffect: hideEffect, duration: _duration);
}
}
« no previous file with comments | « lib/components/alert.html ('k') | lib/components/carousel.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698