Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions example_iframe/zapp-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ window.onmessage = function (e) {
opened = msg.state;
dropdown.style.visibility = opened ? "visible" : "hidden";
button.contentWindow.postMessage(msg, "*");
} else if (msg.type === "open-link") {
window.open(msg.url, '_blank').focus();
button.contentWindow.postMessage(msg, "*");
} else {
console.error("no supported msg type: " + msg.type);
}
Expand Down
9 changes: 9 additions & 0 deletions zapp-iframe/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
6 changes: 5 additions & 1 deletion zapp-iframe/src/lib/components/Dropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'*'
);
}

const cookie = getCookie('zapp-labelson');
if(!cookie) labelson = true;
else labelson = cookie === "true";
Expand Down Expand Up @@ -173,6 +173,10 @@
class="w95in1 w-25 h-25 style absolute"
aria-label={app.img}
title={app.tooltip}
onclick={(event) => {
window.parent.postMessage(JSON.stringify({ type: 'open-link', url: app.url }), '*');
event.preventDefault();
}}
>
<div class="bborder bborder1">
<div class="bborder bborder2">
Expand Down