From 786e7cd769dbe9574603fd1b27ef63e44935685b Mon Sep 17 00:00:00 2001 From: Thaum Date: Mon, 2 Feb 2015 10:48:56 +0000 Subject: [PATCH] Implemented detail view for items and containers --- rpg-docs/client/globalHelpers/GlobalUI.js | 10 +- .../client/views/GeneralCSS/globalDetail.css | 25 +++ .../views/character/effectEdit/effectEdit.js | 7 +- .../features/featureDialog/featureDialog.html | 22 +-- .../features/featureDialog/featureDialog.js | 6 +- .../features/featureDialog/featuresDialog.css | 13 -- .../views/character/features/features.html | 3 +- .../views/character/features/features.js | 5 +- .../containerDialog/containerDialog.html | 57 +++---- .../containerDialog/containerDialog.js | 22 ++- .../views/character/inventory/inventory.html | 8 +- .../views/character/inventory/inventory.js | 34 ++-- .../inventory/itemDialog/itemDialog.html | 151 +++++++++--------- .../inventory/itemDialog/itemDialog.js | 22 ++- 14 files changed, 217 insertions(+), 168 deletions(-) delete mode 100644 rpg-docs/client/views/character/features/featureDialog/featuresDialog.css diff --git a/rpg-docs/client/globalHelpers/GlobalUI.js b/rpg-docs/client/globalHelpers/GlobalUI.js index 14f7289c..e25e4b48 100644 --- a/rpg-docs/client/globalHelpers/GlobalUI.js +++ b/rpg-docs/client/globalHelpers/GlobalUI.js @@ -30,7 +30,7 @@ this.GlobalUI = (function() { }; })(this)); }; - + //To show a detail, first animate the click, with raising z-depth //then call this function with a template and data //the element should have a hero-id of detail-main @@ -40,14 +40,14 @@ this.GlobalUI = (function() { GlobalUI.detailHero = opts.hero; Session.set("global.ui.detailShow", true); }; - + //if setting the detail rather than showing it, //the template should contain the following in template.rendered // //if (!this.alreadyRendered){ - // Session.set("global.ui.detailShow", true); - // this.alreadyRendered = true; - //} + // Session.set("global.ui.detailShow", true); + // this.alreadyRendered = true; + //} GlobalUI.setDetail = function(opts) { Session.set("global.ui.detailData", opts.data); Session.set("global.ui.detailTemplate", opts.template); diff --git a/rpg-docs/client/views/GeneralCSS/globalDetail.css b/rpg-docs/client/views/GeneralCSS/globalDetail.css index 1cb9b4fe..4e453b5d 100644 --- a/rpg-docs/client/views/GeneralCSS/globalDetail.css +++ b/rpg-docs/client/views/GeneralCSS/globalDetail.css @@ -21,11 +21,36 @@ opacity: 0.0; } +.detailContent { + padding: 24px; +} + +#addEffectButton { + background: #d23f31; + color: #fff; + margin-top: 16px; +} #globalDetail { background-color: white; width: 624px; height: 500px; + border-radius: 2px; +} + +#globalDetail core-toolbar { + border-radius: 2px 2px 0 0; +} + +@media (max-width: 640px) { + #globalDetail { + top: 0 !important; + left: 0 !important; + width: 100%; + height: 100%; + margin: 0; + border-radius: 0; + } } .fake-selected [hero] { diff --git a/rpg-docs/client/views/character/effectEdit/effectEdit.js b/rpg-docs/client/views/character/effectEdit/effectEdit.js index 95dbebde..fff32a19 100644 --- a/rpg-docs/client/views/character/effectEdit/effectEdit.js +++ b/rpg-docs/client/views/character/effectEdit/effectEdit.js @@ -321,10 +321,7 @@ Template.effectEdit.events({ } }, "change #effectValueInput": function(event){ - var inst = Template.instance(); - var input = inst.find("#effectValueInput"); - if(!input) return; - var value = input.value; - inst.value.set(value); + var value = event.currentTarget.value; + Template.instance().value.set(value); } }); diff --git a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html index 8dbcdc1c..80a89674 100644 --- a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html +++ b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html @@ -1,7 +1,7 @@