Skip to content

Commit

Permalink
Update button href dynamically
Browse files Browse the repository at this point in the history
also make button a link 'cos buttons can't have hrefs
  • Loading branch information
dbkr committed Sep 11, 2019
1 parent ae18186 commit 3c62829
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vector/mobile_guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
cursor: pointer;
padding: 12px 22px;
word-break: break-word;
text-decoration: none;
}

.mx_Center {
Expand Down Expand Up @@ -360,7 +361,7 @@ <h2>1: Install the app</h2>
<div class="mx_HomePage_row">
<div>
<h2>2: Configure your app</h2>
<button class="mx_Button" id="configure_riot_button" href="#">Configure</button>
<a class="mx_Button" id="configure_riot_button" href="#">Configure</a>
<p class="mx_Subtext">Tap the button above, or manually enable <em>Use custom server</em> and enter:</p>
<p class="mx_Subtext">Homeserver: <em id="hs_url"></em></p>
<p class="mx_Subtext" id="default_is">Identity Server: <em>https://vector.im</em> (default)</p>
Expand Down
3 changes: 3 additions & 0 deletions src/vector/mobile_guide/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ async function initPage() {
if (isUrl && !isUrl.endsWith('/')) isUrl += '/';

if (hsUrl !== 'https://matrix.org/') {
document.getElementById('configure_riot_button').href =
"https://riot.im/config/config?hs_url=" + encodeURIComponent(hsUrl) +
"&is_url=" + encodeURIComponent(isUrl);
document.getElementById('step2_container').style.display = 'block';
document.getElementById('hs_url').innerText = hsUrl;
document.getElementById('step_login_header').innerHTML= '3: Launch the app';
Expand Down

0 comments on commit 3c62829

Please sign in to comment.