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

Side by Side Diff: lib/components/modal.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 unified diff | Download patch
« no previous file with comments | « lib/components/dropdown.html ('k') | lib/components/modal.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import 'dart:async'; 1 import 'dart:async';
2 import 'dart:html'; 2 import 'dart:html';
3 import 'package:web_ui/web_ui.dart'; 3 import 'package:web_ui/web_ui.dart';
4 import 'package:bot/bot.dart'; 4 import 'package:bot/bot.dart';
5 import 'package:widget/effects.dart'; 5 import 'package:widget/effects.dart';
6 import 'package:widget/widget.dart'; 6 import 'package:widget/widget.dart';
7 7
8 // TODO: ESC to close: https://github.com/kevmoo/widget.dart/issues/17 8 // TODO: ESC to close: https://github.com/kevmoo/widget.dart/issues/17
9 9
10 /** 10 /**
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 @protected 63 @protected
64 void inserted() { 64 void inserted() {
65 final modal = _getModalElement(); 65 final modal = _getModalElement();
66 if(modal != null && !isShown) { 66 if(modal != null && !isShown) {
67 ModalManager.hide(modal); 67 ModalManager.hide(modal);
68 } 68 }
69 } 69 }
70 70
71 Element _getModalElement() => this.query('x-modal > .modal'); 71 Element _getModalElement() => this.query('[is=x-modal] > .modal');
72 72
73 void _onClick(MouseEvent event) { 73 void _onClick(MouseEvent event) {
74 if(!event.defaultPrevented) { 74 if(!event.defaultPrevented) {
75 final Element target = event.target as Element; 75 final Element target = event.target as Element;
76 if(target != null && target.dataset['dismiss'] == 'modal') { 76 if(target != null && target.dataset['dismiss'] == 'modal') {
77 hide(); 77 hide();
78 } 78 }
79 } 79 }
80 } 80 }
81 81
82 void _onBackdropClicked() { 82 void _onBackdropClicked() {
83 // TODO: ignoring some edge cases here 83 // TODO: ignoring some edge cases here
84 // like what if this element has been removed from the tree before the backd rop is clicked 84 // like what if this element has been removed from the tree before the backd rop is clicked
85 // ...etc 85 // ...etc
86 hide(); 86 hide();
87 } 87 }
88 } 88 }
OLDNEW
« no previous file with comments | « lib/components/dropdown.html ('k') | lib/components/modal.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698