blob: cc61279c343a86022ea14d24b04b7a29c8ae1bc0 [file] [log] [blame]
<!-- The <detail-page-sk> custom element declaration.
A container element to display the details about a single digest.
Attributes:
None
Methods:
pageSelected: This function has to be called if the page is selected by the router.
pageDeselected: This function has to be called if the page is deselected by the router.
Events:
None
Mailboxes:
None
-->
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="digest-details-sk.html">
<link rel="import" href="shared-styles.html">
<dom-module id="detail-page-sk">
<template>
<style include="shared-styles" clas>
.detailContainer {
margin: 2em 0 0 2em;
}
</style>
<div class="detailContainer">
<digest-details-sk
details="[[data.digest]]"
commits="[[data.commits]]"
mode="detail">
</digest-details-sk>
</div>
<zoom-dialog-sk></zoom-dialog-sk>
</template>
<script>
Polymer({
is: "detail-page-sk",
behaviors: [gold.ZoomTargetBehavior],
ready: function() {
this.listen(this, 'triage', '_handleTriage');
this.listen(this, 'zoom-clicked', '_handleZoomClicked');
},
pageSelected: function(routeName) {
var q = window.location.search;
sk.get("/json/details" + q).then(JSON.parse).then(function (json) {
this.set('data', json);
}.bind(this)).catch(sk.errorMessage);
},
pageDeselected: function() {},
_handleTriage: function(ev) {
ev.stopPropagation();
sk.post('/json/triage', JSON.stringify(ev.detail)).catch(sk.errorMessage);
}
});
</script>
</dom-module>