From 33ca60c2e647ef2b6aa0abd5863922b0f42e4f5a Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 20 Jan 2017 15:45:18 +0200 Subject: [PATCH] Migrated the Feature page to Polymer 1 --- .../client/globalHelpers/openParentDialog.js | 41 +- rpg-docs/client/style/main.css | 7 + .../characterSettings/shareDialog.html | 4 +- .../client/views/character/characterSheet.js | 9 +- .../features/featureDialog/featureDialog.html | 61 ++- .../features/featureDialog/featureDialog.js | 65 ++-- .../views/character/features/features.css | 4 - .../views/character/features/features.html | 110 +++--- .../views/character/features/features.js | 51 ++- .../client/views/character/stats/stats.html | 2 +- .../home/intro/{intro.scss => intro.css} | 0 rpg-docs/client/views/layout/layout.css | 5 - rpg-docs/client/views/layout/layout.html | 26 +- .../client/views/layout/polymerImports.html | 4 + .../colorDropdown/colorDropdown.js | 1 - .../dialogStack/dialogStack.css | 7 +- .../paperTemplates/dialogStack/dialogStack.js | 45 ++- .../public/custom_components/app-theme.html | 28 +- .../dicecloud-selectable.html | 353 ++++++++++++++++++ .../dicecloud-selector.html | 24 ++ 20 files changed, 613 insertions(+), 234 deletions(-) rename rpg-docs/client/views/home/intro/{intro.scss => intro.css} (100%) create mode 100644 rpg-docs/public/custom_components/dicecloud-selector/dicecloud-selectable.html create mode 100644 rpg-docs/public/custom_components/dicecloud-selector/dicecloud-selector.html diff --git a/rpg-docs/client/globalHelpers/openParentDialog.js b/rpg-docs/client/globalHelpers/openParentDialog.js index 7f1528a2..139428fe 100644 --- a/rpg-docs/client/globalHelpers/openParentDialog.js +++ b/rpg-docs/client/globalHelpers/openParentDialog.js @@ -1,32 +1,23 @@ -openParentDialog = function(parent, charId, heroId) { - var detail; +openParentDialog = function({ + parent, charId, element, returnElement, callback, +}) { + let template; + let data; if (parent.collection === "Characters" && parent.group === "racial") { - detail = { - template: "raceDialog", - data: {charId: parent.id}, - }; + template = "raceDialog"; + data = {charId: parent.id}; } else if (parent.collection === "Features") { - detail = { - template: "featureDialog", - data: {featureId: parent.id}, - }; + template = "featureDialog"; + data = {featureId: parent.id}; } else if (parent.collection === "Classes") { - detail = { - template: "classDialog", - data: {classId: parent.id}, - }; + template = "classDialog"; + data = {classId: parent.id}; } else if (parent.collection === "Items") { - detail = { - template: "itemDialog", - data: {itemId: parent.id}, - }; + template = "itemDialog"; + data = {itemId: parent.id}; } else if (parent.collection === "Spells") { - detail = { - template: "spellDialog", - data: {spellId: parent.id}, - }; + template = "spellDialog"; + data = {spellId: parent.id}; } - detail.heroId = heroId; - detail.charId = charId; - GlobalUI.setDetail(detail); + pushDialogStack({template, data, element, returnElement, callback}); }; diff --git a/rpg-docs/client/style/main.css b/rpg-docs/client/style/main.css index 7977a784..7884736f 100644 --- a/rpg-docs/client/style/main.css +++ b/rpg-docs/client/style/main.css @@ -55,6 +55,8 @@ paper-icon-item::shadow #contentIcon { position: fixed; bottom: 24px; right: 24px; + /* stop the fab from flashing during animation */ + transform: translateZ(0); } paper-fab { @@ -75,6 +77,11 @@ paper-button { text-transform: uppercase; } +dicecloud-selector paper-item { + white-space: nowrap; + overflow: hidden; +} + /*Style shortcuts*/ .scroll-y { overflow-y: auto; diff --git a/rpg-docs/client/views/character/characterSettings/shareDialog.html b/rpg-docs/client/views/character/characterSettings/shareDialog.html index 3be53bba..4554da61 100644 --- a/rpg-docs/client/views/character/characterSettings/shareDialog.html +++ b/rpg-docs/client/views/character/characterSettings/shareDialog.html @@ -8,10 +8,10 @@
- + Only people I share with Anyone with link - +
diff --git a/rpg-docs/client/views/character/characterSheet.js b/rpg-docs/client/views/character/characterSheet.js index c29332bf..bbb9b367 100644 --- a/rpg-docs/client/views/character/characterSheet.js +++ b/rpg-docs/client/views/character/characterSheet.js @@ -30,24 +30,21 @@ Template.characterSheet.events({ "color-change": function(event, instance){ Characters.update(this._id, {$set: {color: event.color}}); }, - "tap #deleteCharacter": function(event, instance){ - const menu = instance.find(".character-menu"); + "click #deleteCharacter": function(event, instance){ pushDialogStack({ data: this, template: "deleteCharacterConfirmation", element: event.currentTarget.parentElement.parentElement, }); }, - "tap #shareCharacter": function(event, instance){ - const menu = instance.find(".character-menu"); + "click #shareCharacter": function(event, instance){ pushDialogStack({ data: this, template: "shareDialog", element: event.currentTarget.parentElement.parentElement, }); }, - "tap #characterSettings": function(event, instance){ - const menu = instance.find(".character-menu"); + "click #characterSettings": function(event, instance){ pushDialogStack({ data: this, template: "characterSettings", diff --git a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html index 500da4f9..77dde01c 100644 --- a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html +++ b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html @@ -10,10 +10,9 @@