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);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
html /deep/ .colorDropdown paper-item{
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
html /deep/ .colorDropdown {
|
||||
top: 18px;
|
||||
padding: 0.5em 0 0.25em 16px;
|
||||
width: 150px;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<template name="colorDropdownOld">
|
||||
<paper-dropdown-menu class="colorDropdown {{colorClass color}}" label="Color">
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu class="menu" selected={{color}}>
|
||||
{{#each colors}}
|
||||
<paper-item name={{key}} class="containerMenuItem {{colorClass key}}">{{className}}</paper-item>
|
||||
{{/each}}
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</paper-dropdown-menu>
|
||||
</template>
|
||||
|
||||
<template name="colorDropdown">
|
||||
<paper-menu-button id="colorDropdown">
|
||||
<paper-icon-button icon="editor:format-paint" noink></paper-icon-button>
|
||||
<paper-dropdown class="dropdown" halign="right">
|
||||
<core-menu class="menu">
|
||||
{{#each colors}}
|
||||
<paper-item name={{key}} class="colorMenuItem {{colorClass key}}">{{className}}</paper-item>
|
||||
{{/each}}
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</paper-menu-button>
|
||||
</template>
|
||||
@@ -0,0 +1,15 @@
|
||||
Template.colorDropdown.helpers({
|
||||
colors: function(){
|
||||
return colorOptions;
|
||||
}
|
||||
});
|
||||
|
||||
Template.colorDropdown.events({
|
||||
"tap .colorMenuItem": function(event, instance){
|
||||
var color = event.currentTarget.getAttribute("name");
|
||||
instance.$("#colorDropdown").trigger({
|
||||
type: "color-change",
|
||||
color: color,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
<template name="fabMenu">
|
||||
<paper-fab class="floatyButton expand-menu {{#if active}}active{{/if}}"
|
||||
icon="add"></paper-fab>
|
||||
<div class="{{#if active}}active{{/if}} mini-holder"
|
||||
layout vertical center>
|
||||
{{> UI.contentBlock}}
|
||||
</div>
|
||||
</template>
|
||||
18
rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.js
Normal file
18
rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.js
Normal file
@@ -0,0 +1,18 @@
|
||||
Template.fabMenu.onCreated(function() {
|
||||
this.active = new ReactiveVar(false);
|
||||
});
|
||||
|
||||
Template.fabMenu.helpers({
|
||||
active: function() {
|
||||
return Template.instance().active.get();
|
||||
},
|
||||
});
|
||||
|
||||
Template.fabMenu.events({
|
||||
"tap .expand-menu": function(event, instance) {
|
||||
instance.active.set(!instance.active.get());
|
||||
},
|
||||
"tap .mini-holder paper-fab": function(event, instance) {
|
||||
instance.active.set(false);
|
||||
},
|
||||
});
|
||||
43
rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.scss
Normal file
43
rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.scss
Normal file
@@ -0,0 +1,43 @@
|
||||
.mini-holder {
|
||||
position: absolute;
|
||||
padding: 4px;
|
||||
bottom: 80px;
|
||||
right: 24px;
|
||||
width: 56px;
|
||||
pointer-events: none;
|
||||
flex-direction: column-reverse !important;
|
||||
core-tooltip{
|
||||
transform: scale(0);
|
||||
transition-property: transform;
|
||||
transition-duration: 0.3s;
|
||||
transition-timing-function: ease-in-out;
|
||||
margin: 4px;
|
||||
}
|
||||
&.active {
|
||||
pointer-events: auto;
|
||||
core-tooltip{
|
||||
transform: scale(1);
|
||||
}
|
||||
core-tooltip:nth-child(2){
|
||||
transition-delay: 0.1s;
|
||||
}
|
||||
core-tooltip:nth-child(3){
|
||||
transition-delay: 0.2s;
|
||||
}
|
||||
core-tooltip:nth-child(4){
|
||||
transition-delay: 0.3s;
|
||||
}
|
||||
core-tooltip:nth-child(5){
|
||||
transition-delay: 0.4s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.expand-menu {
|
||||
&::shadow iron-icon {
|
||||
transition: transform 0.3s ease-in-out;
|
||||
}
|
||||
&.active::shadow iron-icon{
|
||||
transform: rotate(405deg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<!--
|
||||
Silly flexbox hack brought to you by
|
||||
http://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid
|
||||
-->
|
||||
<template name="gridPadding">
|
||||
{{#each list}}
|
||||
<div class={{../class}} style="height: 0; margin-top: 0; margin-bottom: 0;"></div>
|
||||
{{/each}}
|
||||
</template>
|
||||
@@ -0,0 +1,6 @@
|
||||
Template.gridPadding.helpers({
|
||||
//create a list of true values with length = num
|
||||
list: function(){
|
||||
return _.range(1, this.num);
|
||||
}
|
||||
});
|
||||
8
rpg-docs/client/views/paperTemplates/ripple/ripple.css
Normal file
8
rpg-docs/client/views/paperTemplates/ripple/ripple.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.custom-ripple {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
color: #D50000;
|
||||
}
|
||||
7
rpg-docs/client/views/paperTemplates/ripple/ripple.html
Normal file
7
rpg-docs/client/views/paperTemplates/ripple/ripple.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<template name="ripple">
|
||||
{{#if color}}
|
||||
<paper-ripple style="color:{{color}}" class="recenteringTouch custom-ripple"></paper-ripple>
|
||||
{{else}}
|
||||
<paper-ripple class="recenteringTouch custom-ripple"></paper-ripple>
|
||||
{{/if}}
|
||||
</template>
|
||||
@@ -0,0 +1,3 @@
|
||||
<template name="undoToast">
|
||||
<div id="undoButton" style="color: #eeff41;">Undo</div>
|
||||
</template>
|
||||
18
rpg-docs/client/views/paperTemplates/undoToast/undoToast.js
Normal file
18
rpg-docs/client/views/paperTemplates/undoToast/undoToast.js
Normal file
@@ -0,0 +1,18 @@
|
||||
Template.undoToast.events({
|
||||
"tap #undoButton": function(event, instance){
|
||||
var collection = window[this.collection];
|
||||
if (!collection){
|
||||
console.warn(
|
||||
"Collection with name ",
|
||||
this.collection,
|
||||
" could not be found"
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (collection.restoreNode){
|
||||
collection.restoreNode(this.id);
|
||||
} else {
|
||||
collection.restore(this.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user