Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

combo button trigger popup help

ANSWERED

Hello everyone,

I am trying to create a combo button trigger. So when the bottom right side is touched or the bottom right button is pressed. a want pop-up question to appear. this is the code I have so far and is not working. Any help would be greatley appreciated. Thnx

index.js:

import document from "document";

let myPopup = document.getElementById("my-popup");
// Show the popup
myPopup.style.display = "inline";

let btnBR = document.getElementById("btn-br");
btnBR.onactivate = function(evt) {  
  console.log("Touched/Pressed Bottom Right");
  myPopup.style.display = "none";
}

index.gui:

<svg id="my-popup" display="none">

  <!-- Black background -->
  <rect class="full-size" fill="fb-black" />

  <!-- Title and text -->
  <use href="#mixed-text-center-mid" class="dialog-mixed-text" fill="fb-white">
    <set href="#top-padding" attributeName="display" to="none" />
    <set href="#header/text" attributeName="text-buffer" to="TEST" />
    <set href="#header/text" attributeName="fill" to="fb-magenta"/>
    <set href="#copy/text" attributeName="text-buffer" to="This is a test?" />
    <set href="#bottom-padding" attributeName="display" to="none" />
  </use>
  
  <!-- BOTTOM RIGHT -->
  <use id="btn-br" href="#combo-button-lower-right" fill="fb-red">
    <set href="combo-button-icon" attributeName="href" to="btn_combo_flag_p.png"/>
    <set href="combo-button-icon-press" attributeName="href" to="btn_combo_flag_p.png"/>
    <set href="combo-button-stroke" attributeName="display" to="inline"/>
  </use>
</svg>

widgets.gui:

<svg>
<defs>
<link rel="stylesheet" href="styles.css" />
<link rel="import" href="/mnt/sysassets/widgets_common.gui" />
<link rel="import" href="/mnt/sysassets/widgets/combo_button_widget.gui" />
<link rel="stylesheet" href="/mnt/sysassets/widgets/dynamic_textarea.css" />
<link rel="import" href="/mnt/sysassets/widgets/dynamic_textarea.gui" />
<link rel="import" href="/mnt/sysassets/widgets/square_button_widget.gui" />
<link rel="import" href="/mnt/sysassets/widgets/mixed_text_widget.gui" />
</defs>
</svg>

SN
Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You want to show the popup onactivate, but you're currently hiding it.

 

  myPopup.style.display = "inline";

View best answer in original post

Best Answer
2 REPLIES 2

You want to show the popup onactivate, but you're currently hiding it.

 

  myPopup.style.display = "inline";
Best Answer

woops, thnx 🙂

SN
Best Answer
0 Votes