bmarian / token-tooltip-alt

A module that adds a tooltip next to the currently hovered token to show some useful information for players and DMs.
MIT License
9 stars 15 forks source link

[BUG] Buttons not working #56

Closed Amuxix closed 3 years ago

Amuxix commented 3 years ago

Describe the bug Some buttons are not working.

To Reproduce Steps to reproduce the behavior:

  1. Open Tooltip Manager
  2. Edit some actor
  3. Click the add button to add a new line or try to delete an existing one.
  4. Nothing happens

Please complete the following information:

Additional context Copy, paste and import also don't seem to work

An export of your tooltip settings

{"gmSettings":{"default":{"items":[{"disposition":"FRIENDLY","items":[{"value":"data.attributes.hp","icon":"fa-heart","expression":false,"isNumber":false,"color":"#ff0000"},{"value":"data.attributes.ac.value","icon":"fa-shield-alt","expression":false,"isNumber":false,"color":"#c0c0c0"},{"value":"data.attributes.speed.value","icon":"fa-shoe-prints","expression":false,"isNumber":false,"color":"#000000"},{"value":"data.attributes.spelldc","icon":"fa-hat-wizard","expression":false,"isNumber":false,"color":"#400080"},{"value":"data.skills.prc.passive","icon":"fa-eye","expression":false,"isNumber":false,"color":"#0000a0"},{"value":"data.skills.inv.passive","icon":"fa-search","expression":false,"isNumber":false,"color":"#ff80ff"}]},{"disposition":"NEUTRAL","items":[{"value":"data.attributes.hp","icon":"fa-heart","expression":false,"isNumber":false,"color":"#ff0000"},{"value":"data.attributes.ac.value","icon":"fa-shield-alt","expression":false,"isNumber":false,"color":"#c0c0c0"},{"value":"data.attributes.speed.value","icon":"fa-shoe-prints","expression":false,"isNumber":false,"color":"#000000"},{"value":"data.attributes.spelldc","icon":"fa-hat-wizard","expression":false,"isNumber":false,"color":"#400080"},{"value":"data.skills.prc.passive","icon":"fa-eye","expression":false,"isNumber":false,"color":"#0000a0"},{"value":"data.skills.inv.passive","icon":"fa-search","expression":false,"isNumber":false,"color":"#ff80ff"}]},{"disposition":"HOSTILE","items":[{"value":"data.attributes.hp","icon":"fa-heart","expression":false,"isNumber":false,"color":"#ff0000"},{"value":"data.attributes.ac.value","icon":"fa-shield-alt","expression":false,"isNumber":false,"color":"#c0c0c0"},{"value":"data.attributes.speed.value","icon":"fa-shoe-prints","expression":false,"isNumber":false,"color":"#000000"},{"value":"data.attributes.spelldc","icon":"fa-hat-wizard","expression":false,"isNumber":false,"color":"#400080"},{"value":"data.skills.prc.passive","icon":"fa-eye","expression":false,"isNumber":false,"color":"#0000a0"},{"value":"data.skills.inv.passive","icon":"fa-search","expression":false,"isNumber":false,"color":"#ff80ff"}]}],"static":{"displayNameInTooltip":false,"useAccentEverywhere":false,"accentColor":"#000000","tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"character":{"items":[{"disposition":"FRIENDLY","items":[{"value":"attributes.hp","icon":"fa-heart","expression":false,"isNumber":false,"color":"#ff0000"},{"value":"attributes.ac.value","icon":"fa-shield-alt","expression":false,"isNumber":false,"color":"#c0c0c0"},{"value":"attributes.speed.value","icon":"fa-shoe-prints","expression":false,"isNumber":false,"color":"#000000"},{"value":"attributes.spelldc","icon":"fa-hat-wizard","expression":false,"isNumber":false,"color":"#400080"},{"value":"skills.prc.passive","icon":"fa-eye","expression":false,"isNumber":false,"color":"#0000a0"},{"value":"skills.inv.passive","icon":"fa-search","expression":false,"isNumber":false,"color":"#ff80ff"}]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":false,"useAccentEverywhere":false,"accentColor":"#000000","tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"npc":{"items":[{"disposition":"FRIENDLY","items":[{"value":"attributes.hp","icon":"fa-heart","expression":false,"isNumber":false,"color":"#ff0000"},{"value":"attributes.ac.value","icon":"fa-shield-alt","expression":false,"isNumber":false,"color":"#c0c0c0"},{"value":"attributes.speed.value","icon":"fa-shoe-prints","expression":false,"isNumber":false,"color":"#000000"},{"value":"attributes.spelldc","icon":"fa-hat-wizard","expression":false,"isNumber":false,"color":"#400080"},{"value":"skills.prc.passive","icon":"fa-eye","expression":false,"isNumber":false,"color":"#0000a0"},{"value":"skills.inv.passive","icon":"fa-search","expression":false,"isNumber":false,"color":"#ff80ff"}]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":true,"useAccentEverywhere":false,"accentColor":"#000000","tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"vehicle":{"items":[{"disposition":"FRIENDLY","items":[{"value":"attributes.hp","icon":"fa-heart","expression":false,"isNumber":false,"color":"#ff0000"},{"value":"attributes.ac.value","icon":"fa-shield-alt","expression":false,"isNumber":false,"color":"#c0c0c0"},{"value":"attributes.speed.value","icon":"fa-shoe-prints","expression":false,"isNumber":false,"color":"#000000"},{"value":"attributes.spelldc","icon":"fa-hat-wizard","expression":false,"isNumber":false,"color":"#400080"},{"value":"skills.prc.passive","icon":"fa-eye","expression":false,"isNumber":false,"color":"#0000a0"},{"value":"skills.inv.passive","icon":"fa-search","expression":false,"isNumber":false,"color":"#ff80ff"}]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":true,"accentColor":"#000000","useAccentColorForEverything":false,"tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"]}}},"playerSettings":{"default":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[{"value":"{hpv=<data.attributes.hp.value>; hpm=<data.attributes.hp.max>; type=<type>; hpv <= 0 ? type == \"npc\" ? \"Dead\" : \"Dying\" : hpv < hpm/2 ? \"Hurt\" : \"Healthy\"}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"},{"value":"data.attributes.hp","icon":"fa-heart","expression":false,"isNumber":false,"color":"#ff0000"},{"value":"{<type> == \"npc\" ? \"NPC\" ; \"Other\"}","icon":"","expression":true,"isNumber":false,"color":"#582c90"}]},{"disposition":"NEUTRAL","items":[{"value":"{attributes.hp.max - attributes.hp.value}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]},{"disposition":"HOSTILE","items":[{"value":"{attributes.hp.max - attributes.hp.value}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]}],"static":{"displayNameInTooltip":"FRIENDLY","useAccentEverywhere":false,"accentColor":"#000000","tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"character":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[{"value":"{hpv=<attributes.hp.value>; hpm=<attributes.hp.max>; hpv <= 0 ? \"DEAD\" : hpv < hpm/2 ? \"Hurt\" : \"Healthy\"}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]},{"disposition":"NEUTRAL","items":[{"value":"{hpv=<attributes.hp.value>; hpm=<attributes.hp.max>; hpv <= 0 ? \"DEAD\" : hpv < hpm/2 ? \"Hurt\" : \"Healthy\"}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]},{"disposition":"HOSTILE","items":[{"value":"{hpv=<attributes.hp.value>; hpm=<attributes.hp.max>; hpv <= 0 ? \"DEAD\" : hpv < hpm/2 ? \"Hurt\" : \"Healthy\"}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]}],"static":{"displayNameInTooltip":"FRIENDLY","useAccentEverywhere":false,"accentColor":"#000000","tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"npc":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[{"value":"{hpv=<attributes.hp.value>; hpm=<attributes.hp.max>; hpv <= 0 ? \"DEAD\" : hpv < hpm/2 ? \"Hurt\" : \"Healthy\"}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]},{"disposition":"NEUTRAL","items":[{"value":"{hpv=<attributes.hp.value>; hpm=<attributes.hp.max>; hpv <= 0 ? \"DEAD\" : hpv < hpm/2 ? \"Hurt\" : \"Healthy\"}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]},{"disposition":"HOSTILE","items":[{"value":"{hpv=<attributes.hp.value>; hpm=<attributes.hp.max>; hpv <= 0 ? \"DEAD\" : hpv < hpm/2 ? \"Hurt\" : \"Healthy\"}","icon":"fa-heart-broken","expression":true,"isNumber":false,"color":"#aa0000"}]}],"static":{"displayNameInTooltip":"NEUTRAL","useAccentEverywhere":false,"accentColor":"#000000","tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"vehicle":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":"FRIENDLY","accentColor":"#000000","useAccentColorForEverything":false,"tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"]}}}}
bmarian commented 3 years ago

Let me know if you are getting any errors in the console. Because everything works as expected for me,

Amuxix commented 3 years ago

No errors at all. This bug seemed fishy to me too, I even tried restarting and reinstalling the module to see if it helped but it didn't

Amuxix commented 3 years ago

Ok finally got a possible issue. When opening one of the actor settings manager, I get this:

foundry.js:4481 ReferenceError: An error occurred while rendering TooltipEditor 62: Sortable is not defined
    at HTMLTableSectionElement.<anonymous> (TooltipEditor.js:157)
    at Function.each (jquery.min.js:2)
    at S.fn.init.each (jquery.min.js:2)
    at TooltipEditor.activateListeners (TooltipEditor.js:154)
    at TooltipEditor._render (foundry.js:4537)
    at async TooltipEditor._render (foundry.js:5163)
Amuxix commented 3 years ago

Ok found the issue, the new dependency (Sortable) was not enabled.