-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added moving item dialog, that can't actually be triggered
- Loading branch information
1 parent
314ce85
commit 248ab9b
Showing
9 changed files
with
145 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
html /deep/ .moveItemDialog paper-tabs::shadow #selectionBar { | ||
background-color: #D50000; | ||
} | ||
|
||
html /deep/ .moveItemDialog paper-tab::shadow #ink { | ||
color: #D50000; | ||
} |
49 changes: 49 additions & 0 deletions
49
rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template name="moveItemDialog"> | ||
<div class="moveItemDialog"> | ||
<paper-tabs selected="{{selectedTab}}"> | ||
<paper-tab name="containers" | ||
class="clickable"> | ||
Containers | ||
</paper-tab> | ||
<paper-tab name="characters" | ||
class="clickable"> | ||
Characters | ||
</paper-tab> | ||
</paper-tabs> | ||
<core-animated-pages selected="{{selectedTab}}" | ||
transitions="slide-from-right" | ||
style="width: 250px; | ||
height: 200px; | ||
overflow-y: auto; | ||
overflow-x: hidden;"> | ||
<section name="containers"> | ||
<core-menu id="containerMenu" style="margin: 0;"> | ||
{{#each containers}} | ||
<paper-item name={{_id}} | ||
layout horizontal center> | ||
<core-icon icon="image:brightness-1" | ||
style="color: {{hexColor color}}; | ||
margin-right: 16px;"> | ||
</core-icon> | ||
<div>{{name}}</div> | ||
</paper-item> | ||
{{/each}} | ||
</core-menu> | ||
</section> | ||
<section name="characters"> | ||
<core-menu id="characterMenu" style="margin: 0;"> | ||
{{#each characters}} | ||
<paper-item name={{_id}} | ||
layout horizontal center> | ||
<div class="item small"> | ||
{{name}} | ||
</div> | ||
</paper-item> | ||
{{/each}} | ||
</core-menu> | ||
</section> | ||
</core-animated-pages> | ||
</div> | ||
<paper-button id="cancelButton" affirmative> Cancel </paper-button> | ||
<paper-button id="moveButton" affirmative> Move </paper-button> | ||
</template> |
56 changes: 56 additions & 0 deletions
56
rpg-docs/client/views/character/inventory/moveItemDialog/moveItemDialog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
}, | ||
}); |
2 changes: 1 addition & 1 deletion
2
rpg-docs/client/views/character/stats/healthCard/healthCard.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.healthCard paper-slider{ | ||
.healthCard paper-diff-slider{ | ||
width: 100%; | ||
margin-right: 8px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters