Generalised some dialogs
This commit is contained in:
@@ -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>
|
||||
@@ -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()
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user