diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/tooltips.js b/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/tooltips.js index e3870768341..49d7ccdbc03 100644 --- a/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/tooltips.js +++ b/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/tooltips.js @@ -8,10 +8,11 @@ import DummyComponent from "discourse/plugins/styleguide/discourse/components/du export default class Tooltips extends Component { @service tooltip; + @service site; @tracked label = "What is this?"; - @tracked triggers = TOOLTIP.options.triggers; - @tracked untriggers = TOOLTIP.options.untriggers; + @tracked triggers = TOOLTIP.options.triggers[this.triggersByDevice]; + @tracked untriggers = TOOLTIP.options.untriggers[this.triggersByDevice]; @tracked arrow = TOOLTIP.options.arrow; @tracked inline = TOOLTIP.options.inline; @tracked interactive = TOOLTIP.options.interactive; @@ -20,6 +21,10 @@ export default class Tooltips extends Component { @tracked offset = TOOLTIP.options.offset; @tracked _content = "Hello World!"; + get triggersByDevice() { + return this.site.mobileView ? "mobile" : "desktop"; + } + get content() { return this._content; }