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

Issue 845283003: Allow on-* event handlers on <sky-element>. (Closed)

Created:
5 years, 11 months ago by esprehn
Modified:
5 years, 11 months ago
Reviewers:
ojan
CC:
ojan, abarth-chromium, mojo-reviews_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Allow on-* event handlers on <sky-element>. Now instead of calling addEventListener inside the created() callback you just add on-{eventName} attributes to the <sky-element> around your element definition. The attribute defines what method on your element to call when the event with {eventName} is dispatched through your element. Implementing this required refactoring how sky-element.sky stored information from each registered element. Now instead of storing just a map of templates we store a map of ElementRegistration objects which have metadata about the element. Future patches will combine this system with the element registration system in sky-binder. R=ojan@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/6c501416f074c22d6bd424bea3a76ffc601dff6e

Patch Set 1 #

Patch Set 2 : Add back attr validation. #

Total comments: 1

Patch Set 3 : s p a c i n g #

Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -73 lines) Patch
M sky/framework/sky-button/sky-button.sky View 2 chunks +17 lines, -11 lines 0 comments Download
M sky/framework/sky-checkbox/sky-checkbox.sky View 3 chunks +7 lines, -5 lines 0 comments Download
M sky/framework/sky-element/sky-element.sky View 1 2 5 chunks +108 lines, -45 lines 0 comments Download
M sky/framework/sky-radio/sky-radio.sky View 3 chunks +7 lines, -5 lines 0 comments Download
M sky/tests/framework/templates.sky View 2 chunks +10 lines, -1 line 0 comments Download
M sky/tests/framework/templates-expected.txt View 2 chunks +6 lines, -5 lines 0 comments Download
M sky/tests/resources/test-element.sky View 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
esprehn
5 years, 11 months ago (2015-01-13 00:53:02 UTC) #1
ojan
lgtm https://codereview.chromium.org/845283003/diff/20001/sky/framework/sky-element/sky-element.sky File sky/framework/sky-element/sky-element.sky (right): https://codereview.chromium.org/845283003/diff/20001/sky/framework/sky-element/sky-element.sky#newcode75 sky/framework/sky-element/sky-element.sky:75: getEventHandler(eventName) { Nit: I'd put an extra line ...
5 years, 11 months ago (2015-01-13 01:02:46 UTC) #2
esprehn
5 years, 11 months ago (2015-01-13 02:25:26 UTC) #3
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
6c501416f074c22d6bd424bea3a76ffc601dff6e (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698