Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0789e4d759 | ||
|
|
39c91f58e4 | ||
|
|
c84342b21a | ||
|
|
0373feb2ea | ||
|
|
0b11595657 |
@@ -30,7 +30,7 @@ Template.itemLibraryDialog.onCreated(function(){
|
||||
if (_.contains(categoryKeys, key)){
|
||||
handle = librarySubs.subscribe("standardLibraryItems", key);
|
||||
} else {
|
||||
handle = librarySubs.subscribe("libraryItems", key);
|
||||
handle = librarySubs.subscribe("fullLibraryItems", key);
|
||||
}
|
||||
this.autorun(() => {
|
||||
this.readyDict.set(key, handle.ready());
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.library-item-dialog paper-input {
|
||||
min-width: 160px;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<template name="libraryItemDialog">
|
||||
<div class="fit base-dialog layout vertical">
|
||||
<div class="fit base-dialog layout vertical library-item-dialog">
|
||||
<app-toolbar>
|
||||
<paper-icon-button id="backButton"
|
||||
icon="arrow-back">
|
||||
@@ -24,8 +24,8 @@
|
||||
</paper-checkbox>
|
||||
</div>
|
||||
<div class="layout horizontal center wrap">
|
||||
<paper-input id="libraryItemValueInput" class="flex" label="Value" type="number" value={{item.value}} disabled="{{cantEdit}}"></paper-input>
|
||||
<paper-input id="libraryItemWeightInput" class="flex" label="Weight" type="number" value={{item.weight}} disabled="{{cantEdit}}"></paper-input>
|
||||
<paper-input id="libraryItemValueInput" class="flex" label="Value" type="number" value={{item.value}} disabled="{{cantEdit}}"></paper-input>
|
||||
<paper-checkbox id="attunementCheckbox" class="flex" checked={{item.requiresAttunement}} disabled="{{cantEdit}}">
|
||||
Requires Attunement
|
||||
</paper-checkbox>
|
||||
@@ -34,7 +34,7 @@
|
||||
<div style="margin-top: 8px;">
|
||||
<div class="paper-font-subhead">Effects</div>
|
||||
{{#each indexedEffects}}
|
||||
<div class="effect layout horizontal center wrap">
|
||||
<div class="effect layout horizontal center wrap" style="margin-bottom: 32px;">
|
||||
<paper-dropdown-menu label="Operation" class="operationMenu" disabled="{{cantEdit}}">
|
||||
<paper-listbox class="dropdown-content" selected={{operationIndex operation}}>
|
||||
<paper-item label="Base Value" name="base"> Base Value </paper-item>
|
||||
@@ -59,7 +59,7 @@
|
||||
<div style="margin-top: 8px;">
|
||||
<div class="paper-font-subhead">Attacks</div>
|
||||
{{#each indexedAttacks}}
|
||||
<div class="effect layout horizontal center wrap">
|
||||
<div class="effect layout horizontal center wrap" style="margin-bottom: 32px">
|
||||
<paper-input class="LibraryItemAttackBonusInput flex" label="Attack Bonus" value={{attackBonus}} disabled="{{cantEdit}}"></paper-input>
|
||||
<paper-input class="LibraryItemAttackDamageInput flex" label="Damage" value={{damage}} disabled="{{cantEdit}}"></paper-input>
|
||||
<paper-input class="LibraryItemAttackDetailsInput flex" label="Details" value={{details}} disabled="{{cantEdit}}"></paper-input>
|
||||
|
||||
@@ -66,7 +66,9 @@ Template.libraryItemDialog.helpers({
|
||||
return Template.instance().subscriptionsReady();
|
||||
},
|
||||
cantEdit(){
|
||||
let item = LibraryItems.findOne(this.itemId);
|
||||
// Get itemId from the top level template data regardless of current context
|
||||
let itemId = Blaze.getData(Template.instance().view).itemId;
|
||||
let item = LibraryItems.findOne(itemId);
|
||||
if (!item) return;
|
||||
let library = Libraries.findOne(item.library);
|
||||
if (!library) return;
|
||||
|
||||
@@ -63,6 +63,12 @@ Meteor.publish("libraryItems", function(libraryId){
|
||||
});
|
||||
});
|
||||
|
||||
Meteor.publish("fullLibraryItems", function(libraryId){
|
||||
return LibraryItems.find({
|
||||
library: libraryId
|
||||
});
|
||||
});
|
||||
|
||||
Meteor.publish("libraryItem", function(itemId){
|
||||
let cursor = LibraryItems.find(itemId);
|
||||
let item = cursor.fetch()[0];
|
||||
|
||||
Reference in New Issue
Block a user