diff --git a/rpg-docs/client/views/character/inventory/inventory.js b/rpg-docs/client/views/character/inventory/inventory.js index 72b1fb194..58e70ea2c 100644 --- a/rpg-docs/client/views/character/inventory/inventory.js +++ b/rpg-docs/client/views/character/inventory/inventory.js @@ -174,6 +174,20 @@ Template.inventory.events({ heroId: itemId, }); }, + "hold .inventoryItem": function(event, instance) { + var itemId = this._id; + var charId = Template.parentData()._id; + var containerId = this.parent.id; + GlobalUI.showDialog({ + template: "moveItemDialog", + data: { + charId: charId, + itemId: itemId, + containerId: containerId, + }, + heading: "Move " + this.pluralName(), + }); + }, "tap .incrementButtons": function(event) { event.stopPropagation(); }, diff --git a/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.css b/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.css new file mode 100644 index 000000000..5762ebbf1 --- /dev/null +++ b/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.css @@ -0,0 +1,7 @@ +html /deep/ .moveItemDialog paper-tabs::shadow #selectionBar { + background-color: #D50000; +} + +html /deep/ .moveItemDialog paper-tab::shadow #ink { + color: #D50000; +} diff --git a/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.html b/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.html new file mode 100644 index 000000000..d11cfa41c --- /dev/null +++ b/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.html @@ -0,0 +1,49 @@ + diff --git a/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.js b/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.js new file mode 100644 index 000000000..cf69a7564 --- /dev/null +++ b/rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.js @@ -0,0 +1,56 @@ +Template.moveItemDialog.onCreated(function() { + Session.setDefault("moveItemDialogTab", "containers"); +}); + +Template.moveItemDialog.helpers({ + selectedTab: function() { + return Session.get("moveItemDialogTab"); + }, + characters: function() { + var userId = Meteor.userId(); + return Characters.find( + { + $or: [ + {readers: userId}, + {writers: userId}, + {owner: userId}, + ], + _id: {$ne: this.charId}, + }, + {fields: {name: 1}} + ); + }, + containers: function(){ + return Containers.find( + { + charId: this.charId, + _id: {$ne: this.containerId}, + }, + { + fields: {color: 1, name: 1}, + sort: {color: 1, name: 1}, + } + ); + }, +}); + +Template.moveItemDialog.events({ + "tap paper-tab": function(event) { + Session.set("moveItemDialogTab", event.currentTarget.getAttribute("name")); + }, + "tap #moveButton": function(event, instance) { + var tab = Session.get("moveItemDialogTab"); + if (tab === "containers"){ + var containerId = instance.find("#containerMenu").selected; + if (!containerId) throw "no menu selection"; + Meteor.call("moveItemToContainer", this.itemId, containerId); + } else if (tab === "characters"){ + var characterId = instance.find("#characterMenu").selected; + if (!characterId) throw "no menu selection"; + Meteor.call("moveItemToCharacter", this.itemId, characterId); + } else { + throw "Move item dialog tab is not set to containers or character," + + " it is set to " + tab; + } + }, +}); diff --git a/rpg-docs/client/views/character/stats/healthCard/healthCard.css b/rpg-docs/client/views/character/stats/healthCard/healthCard.css index a170d09e8..98280aaf6 100644 --- a/rpg-docs/client/views/character/stats/healthCard/healthCard.css +++ b/rpg-docs/client/views/character/stats/healthCard/healthCard.css @@ -1,4 +1,4 @@ -.healthCard paper-slider{ +.healthCard paper-diff-slider{ width: 100%; margin-right: 8px; } diff --git a/rpg-docs/client/views/character/stats/healthCard/healthCard.html b/rpg-docs/client/views/character/stats/healthCard/healthCard.html index 20c3a7889..56f035e9d 100644 --- a/rpg-docs/client/views/character/stats/healthCard/healthCard.html +++ b/rpg-docs/client/views/character/stats/healthCard/healthCard.html @@ -10,24 +10,24 @@
- + >
{{#each tempHitPoints}}
{{name}}
- + > {{#unless left}}{{#unless deleteOnZero}} {{/unless}}{{/unless}} diff --git a/rpg-docs/client/views/layout/imports.html b/rpg-docs/client/views/layout/imports.html index 911456ec9..bedc1ce6d 100644 --- a/rpg-docs/client/views/layout/imports.html +++ b/rpg-docs/client/views/layout/imports.html @@ -33,11 +33,12 @@ + - + diff --git a/rpg-docs/public/custom_components/paper-slider-diff/paper-slider.css b/rpg-docs/public/custom_components/paper-diff-slider/paper-diff-slider.css similarity index 100% rename from rpg-docs/public/custom_components/paper-slider-diff/paper-slider.css rename to rpg-docs/public/custom_components/paper-diff-slider/paper-diff-slider.css diff --git a/rpg-docs/public/custom_components/paper-slider-diff/paper-slider.html b/rpg-docs/public/custom_components/paper-diff-slider/paper-diff-slider.html similarity index 92% rename from rpg-docs/public/custom_components/paper-slider-diff/paper-slider.html rename to rpg-docs/public/custom_components/paper-diff-slider/paper-diff-slider.html index b991e1905..0a2e283b9 100644 --- a/rpg-docs/public/custom_components/paper-slider-diff/paper-slider.html +++ b/rpg-docs/public/custom_components/paper-diff-slider/paper-diff-slider.html @@ -8,55 +8,55 @@ --> @@ -65,10 +65,10 @@ - +