Generalised some dialogs

This commit is contained in:
Thaum
2015-02-27 06:14:34 +00:00
parent 56f8e95d81
commit 040d5a514b
50 changed files with 532 additions and 954 deletions

View File

@@ -0,0 +1,23 @@
<template name="baseDialog">
<core-header-panel fit>
<core-toolbar class={{class}} hero-id="toolbar" hero>
<paper-icon-button id="backButton" role="button" tabindex="0" icon="arrow-back" aria-label="close"></paper-icon-button>
<div flex>{{title}}</div>
{{#if hideColor}}{{else}}
<!--color-->
{{> colorDropdown}}
{{/if}}
{{#if hideDelete}}{{else}}
<paper-icon-button id="deleteButton"
role="button"
tabindex="0"
icon="delete"
aria-label="Delete Feature"
noink></paper-icon-button>
{{/if}}
</core-toolbar>
<div class="detailContent">
{{> UI.contentBlock}}
</div>
</core-header-panel>
</template>

View File

@@ -0,0 +1,24 @@
Template.baseDialog.rendered = function(){
var self = this;
//update all autogrows after they've been filled
var pata = this.$("paper-autogrow-textarea");
pata.each(function(index, el){
el.update($(el).children().get(0));
})
//update all input fields as well
var input = this.$("paper-input");
input.each(function(index, el){
el.valueChanged();
})
//after the dialog is built, open it
if (!this.alreadyRendered){
Session.set("global.ui.detailShow", true);
this.alreadyRendered = true;
}
}
Template.baseDialog.events({
"tap #backButton": function(){
GlobalUI.closeDetail()
}
});