Skip to content

Commit

Permalink
Merge branch 'hotfix-item-libraries'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaumRystra committed May 7, 2019
2 parents 0b11595 + 39c91f5 commit 0789e4d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.library-item-dialog paper-input {
min-width: 160px;
}
Original file line number Diff line number Diff line change
@@ -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">
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0789e4d

Please sign in to comment.