This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Polymer/polymer-dev
- Loading branch information
Showing
3 changed files
with
100 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>async test</title> | ||
<title>polymer-body test</title> | ||
<script src="../../../platform/platform.js"></script> | ||
<link rel="import" href="../../polymer.html"> | ||
<script src="../../../tools/test/htmltest.js"></script> | ||
<script src="../../../tools/test/chai/chai.js"></script> | ||
</head> | ||
<body is="polymer-body" unresolved> | ||
<h2 on-tap="{{eventAction}}">{{greeting}}</h2> | ||
<div>top</div> | ||
|
||
<template> | ||
<h2 id="h" on-tap="{{eventAction}}">{{greeting}}</h2> | ||
</template> | ||
|
||
<div>bottom</div> | ||
|
||
<script> | ||
model = { | ||
greeting: 'Hi!', | ||
ready: function() { | ||
var h = document.body.querySelector('h2'); | ||
greeting: 'Hi', | ||
eventAction: function(e) { | ||
e.handled = true; | ||
}, | ||
test: function() { | ||
var h = this.$.h; | ||
chai.assert.equal(h.textContent, this.greeting, 'binding applied'); | ||
var e = this.fire('tap', {}, h); | ||
chai.assert.isTrue(e.handled, 'element event handler fired'); | ||
e = this.fire('pointerdown'); | ||
chai.assert.isTrue(e.handled, 'host event handler fired'); | ||
done(); | ||
}, | ||
eventAction: function(e) { | ||
e.handled = true; | ||
}, | ||
eventDelegates: { | ||
pointerdown: 'eventAction' | ||
} | ||
} | ||
|
||
addEventListener('polymer-ready', function() { | ||
wrap(document.body).async('test'); | ||
}); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |