Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Optimize tx-table for mobile screen #1804

Merged
merged 16 commits into from
Aug 25, 2022
Merged
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
4 changes: 4 additions & 0 deletions src/cryptoadvance/specter/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,10 @@ This style is used for a div at the bottom in the <main> element to create a dis
}
}
@media (max-width: 690px){
.table-holder{
padding-left: 10px;
padding-right: 10px;
}
.card{
border-width: 0px;
width: auto;
Expand Down
3 changes: 2 additions & 1 deletion src/cryptoadvance/specter/templates/includes/tx-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
// Select tx option
if (this.mode == 'utxo') {
this.selectTxImg.classList.remove('hidden');
this.selectTxImg.onclick = () => {
this.selectTxImg.onclick = (e) => {
this.selectTxImg.src = this.selectTxValue.value ? `{{ url_for('static', filename='img/checkbox-untick.svg') }}` : `{{ url_for('static', filename='img/checkbox-tick.svg') }}`;
this.selectTxValue.value = this.selectTxValue.value ? "" : "true";
let event = new CustomEvent('txRowSelected', { detail: {
Expand All @@ -353,6 +353,7 @@
locked: this.tx.locked,
} });
this.dispatchEvent(event);
e.stopPropagation(); // this prevent the onclick of outer divs to be triggered
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@relativisticelectron could you explain this? Which onclick listeneres picked that up? Where did that bubble to? I thought it would be contained within the web component.

Copy link
Collaborator Author

@relativisticelectron relativisticelectron Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire row becomes clickable

The propagation to the outer div has to be stopped.

}
} else {
this.selectTxImg.classList.add('hidden');
Expand Down
8 changes: 7 additions & 1 deletion src/cryptoadvance/specter/templates/includes/tx-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
align-items: center;
}
.selected-rows-action-box .btn {
width: 200px;
min-width: 170px;
margin: 5px;
height: 38px;
}
Expand Down Expand Up @@ -200,6 +200,7 @@
width: 100%;
margin-bottom: 10px;
border: 1.5px solid var(--cmap-border);
overflow-x: auto;
}
.scrollbar {
overflow-y: auto;
Expand Down Expand Up @@ -265,6 +266,11 @@
flex-direction: column;
height: 100%;
}
@media (max-width: 690px){
.selected-rows-action-box{
flex-direction: column;
}
}
</style>

<nav class="switcher row">
Expand Down