Moved views out of private folder
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<template name="baseDialog">
|
||||
<div class="{{class}} top subhead"
|
||||
style="height: 72px;"
|
||||
hero-id="toolbar" hero
|
||||
layout horizontal center>
|
||||
<paper-icon-button id="backButton"
|
||||
icon="arrow-back">
|
||||
</paper-icon-button>
|
||||
<div flex>{{title}}</div>
|
||||
{{#if editing}}
|
||||
{{#unless hideDelete}}
|
||||
<paper-icon-button id="deleteButton"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
icon="delete"
|
||||
aria-label="Delete Feature">
|
||||
</paper-icon-button>
|
||||
{{/unless}}
|
||||
{{#unless hideColor}}
|
||||
{{> colorDropdown}}
|
||||
{{/unless}}
|
||||
<paper-icon-button id="doneEditingButton"
|
||||
icon="done"
|
||||
aria-label="Delete Feature">
|
||||
</paper-icon-button>
|
||||
{{else}}
|
||||
{{#if showEdit}}
|
||||
<paper-icon-button id="editButton"
|
||||
icon="create"
|
||||
aria-label="Delete Feature">
|
||||
</paper-icon-button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="bottom scroll-y"
|
||||
style="padding: 24px"
|
||||
flex>
|
||||
{{#unless editing}}
|
||||
{{> UI.contentBlock}}
|
||||
{{else}}
|
||||
{{> UI.elseBlock}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,30 @@
|
||||
Template.baseDialog.onCreated(function(){
|
||||
this.editing = new ReactiveVar(!!this.data.startEditing);
|
||||
});
|
||||
|
||||
Template.baseDialog.onRendered(function(){
|
||||
//after the dialog is built, open it
|
||||
Session.set("global.ui.detailShow", true);
|
||||
});
|
||||
|
||||
Template.baseDialog.helpers({
|
||||
editing: function(){
|
||||
return Template.instance().editing.get() && canEditCharacter(Template.parentData().charId);
|
||||
},
|
||||
showEdit: function() {
|
||||
if (this.hideEdit) return false;
|
||||
return canEditCharacter(Template.parentData().charId);
|
||||
},
|
||||
});
|
||||
|
||||
Template.baseDialog.events({
|
||||
"tap #backButton": function(){
|
||||
GlobalUI.closeDetail();
|
||||
},
|
||||
"tap #editButton": function(event, instance){
|
||||
instance.editing.set(true);
|
||||
},
|
||||
"tap #doneEditingButton": function(event, instance){
|
||||
instance.editing.set(false);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user