Skip to content

Commit

Permalink
fix: improve tooltip button generation and remove unnecessary console…
Browse files Browse the repository at this point in the history
… logs
  • Loading branch information
swoopertr committed Jan 8, 2025
1 parent 4af6604 commit ac2cef4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions jsAgent/hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ bw.hint = {

for (let i = 0; i < hintData.length; i++) {
const item = hintData[i];
console.log(item);

const tooltip = bw.hint.generateTooltip(item);
const header = bw.hint.generateHeader(item);

const contentContainer = bw.hint.generateContentContainer(item);
const content = bw.hint.generateContent(item);
const button = bw.hint.generateButton(item);

contentContainer.appendChild(content);
contentContainer.appendChild(button);

if(item.action !== 'no action'){
const button = bw.hint.generateButton(item);
contentContainer.appendChild(button);
}


tooltip.appendChild(header);
tooltip.appendChild(contentContainer);
Expand Down Expand Up @@ -184,8 +188,7 @@ bw.hint = {

button.addEventListener('click', () => {
if(btnEvent == 'no action'){
//bw.hint.hideModal();
console.log('no action');

}
else if(btnEvent == 'open url'){
location.href = item.actionButtonUrl;
Expand Down
2 changes: 1 addition & 1 deletion jsAgent/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ bw.popup = {
${bw.popup.addHeader(option.header, option.headerBackgroundColor, option.headerColor, option.padding)}
<div class="modal-body" style='padding: ${option.padding}px ${option.padding}px; display: flex; justify-content: space-between; flex-direction: column; box-sizing: border-box; font-family: "Inter", sans-serif; font-size: 13px; min-height: 227px; '>
${option.content}
${bw.popup.addButton(option.actionButtonText, option.buttonBackgroundColor, option.buttonTextColor, option.padding, `bw-popup-btn`)}
${option.closeButtonAction !== 'no action' ? bw.popup.addButton(option.actionButtonText, option.buttonBackgroundColor, option.buttonTextColor, option.padding, `bw-popup-btn`): ''}
</div>
</div>
</div>`;
Expand Down

0 comments on commit ac2cef4

Please sign in to comment.