Changed rpg-docs folder to app
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<!-- data needs to include id of item, parentCollection, parentId -->
|
||||
<template name="splitStackDialog">
|
||||
<div class="fit layout vertical">
|
||||
<app-header-layout has-scrolling-region class="feedback flex">
|
||||
<app-header fixed effects="waterfall">
|
||||
<app-toolbar>
|
||||
Split Stack
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<div class="form flex">
|
||||
<paper-input autoFocus label="Quantity" id="quantityInput" type="number" value={{quantity}}>
|
||||
</paper-input>
|
||||
<div class="layout horizontal justified">
|
||||
<paper-button id="oneButton"> One </paper-button>
|
||||
<paper-button id="halfButton"> Half </paper-button>
|
||||
<paper-button id="allButton"> All </paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</app-header-layout>
|
||||
<div class="buttons layout horizontal end-justified">
|
||||
<paper-button id="cancelButton">
|
||||
Cancel
|
||||
</paper-button>
|
||||
<paper-button id="moveButton">
|
||||
move
|
||||
</paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,35 @@
|
||||
Template.splitStackDialog.onRendered(function(){
|
||||
this.find("#quantityInput").focus();
|
||||
});
|
||||
|
||||
Template.splitStackDialog.helpers({
|
||||
quantity: function(){
|
||||
var item = Items.findOne(this.id);
|
||||
if (item) return Math.round(item.quantity / 2);
|
||||
}
|
||||
});
|
||||
|
||||
Template.splitStackDialog.events({
|
||||
"click #moveButton": function(event, instance){
|
||||
Meteor.call(
|
||||
"splitItemToParent",
|
||||
this.id,
|
||||
+instance.find("#quantityInput").value,
|
||||
{collection: this.parentCollection , id: this.parentId}
|
||||
);
|
||||
popDialogStack();
|
||||
},
|
||||
"click #cancelButton": function(event, instance){
|
||||
popDialogStack();
|
||||
},
|
||||
"click #oneButton":function(event, instance){
|
||||
instance.find("#quantityInput").value = 1;
|
||||
},
|
||||
"click #halfButton":function(event, instance){
|
||||
var val = Math.round(Items.findOne(this.id).quantity / 2);
|
||||
instance.find("#quantityInput").value = val;
|
||||
},
|
||||
"click #allButton":function(event, instance){
|
||||
instance.find("#quantityInput").value = Items.findOne(this.id).quantity;
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user