Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WatNA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
WatNA
Commits
ab40c420
Commit
ab40c420
authored
3 years ago
by
Michal Malý
Browse files
Options
Downloads
Patches
Plain Diff
Re-mark all cells of selected fragments in the Browse table when the
table is expanded
parent
ca0681e8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.html
+30
-9
30 additions, 9 deletions
index.html
molstar
+1
-1
1 addition, 1 deletion
molstar
with
31 additions
and
10 deletions
index.html
+
30
−
9
View file @
ab40c420
...
...
@@ -345,6 +345,23 @@ async function browse_fragment_clicked(elem, ntc, seq) {
structural_in_table_clicked
(
elem
,
'
wva-app-browse
'
,
'
wva-app-browse-viewer
'
,
handler
);
}
/*
* Walks the Browse table and marks all cells of selected fragments with the appropriate color.
*
* This has to be done when the Browse table is collapsed and then expanded again.
*/
function
mark_selected_in_browse
()
{
for
(
const
ntc
of
WATNA_NTCS
)
{
for
(
const
seq
of
watna_sequences
())
{
const
fragId
=
mkFragId
(
ntc
,
seq
);
const
elem
=
document
.
getElementById
(
fragment_cell_id
(
fragId
,
'
browse
'
));
if
(
elem
)
{
watna_set_elem_color
(
elem
,
'
wva-app-browse
'
,
fragId
);
}
}
}
}
/*
* Handles a click on a structure in the Predictions tab
*/
...
...
@@ -476,14 +493,17 @@ function mk_ntc_seq_table_code(ntcs, titleHTML) {
}
/* Sequences horizontal, NtC classes vertical */
function
mk_seq_ntc_table_code
(
ntcs
,
sequences
,
title
,
title_collapsed
,
tainer_id
,
coll_expd_callback
)
{
function
mk_seq_ntc_table_code
(
ntcs
,
sequences
,
title
,
title_collapsed
,
tainer_id
,
coll_expd_callback
s
)
{
let
has_unreliable
=
false
;
let
code
=
''
;
let
code_collapsed
=
''
;
COLL_EXPD_CALLBACKS
[
tainer_id
]
=
(
state
)
=>
{
if
(
coll_expd_callback
)
coll_expd_callback
(
state
);
if
(
coll_expd_callbacks
)
{
for
(
const
callback
of
coll_expd_callbacks
)
{
callback
(
state
);
}
}
};
code
+=
'
<table class="ntc-seq-table">
'
;
...
...
@@ -492,10 +512,11 @@ function mk_seq_ntc_table_code(ntcs, sequences, title, title_collapsed, tainer_i
if
(
tainer_id
)
{
code
+=
'
<div class="collapsible-table-header">
'
code
+=
title
;
code
+=
`<div class="wva-pushbutton wva-pushbutton-border wva-symbolic-pushbutton" onclick="document.querySelector('#
${
tainer_id
}
').innerHTML = PREGENERATED_TABLES['
${
tainer_id
}
'].collapsed; COLL_EXPD_CALLBACKS['
${
tainer_id
}
']('collapsed'); redraw_molstar();"><img src="assets/imgs/triangle-down.svg" /></div>`
;
code
+=
`<div class="wva-pushbutton wva-pushbutton-border wva-symbolic-pushbutton" onclick="document.querySelector('#
${
tainer_id
}
').innerHTML = PREGENERATED_TABLES['
${
tainer_id
}
'].collapsed; COLL_EXPD_CALLBACKS['
${
tainer_id
}
']('collapsed'); redraw_molstar();"><img src="assets/imgs/triangle-down.svg" /></div>`
;
code
+=
'
</div>
'
;
}
else
}
else
{
code
=
`<div class="ntc-seq-title-text">
${
title
}
</div>`
;
}
code
+=
'
</td></tr>
'
;
/* Make table header */
...
...
@@ -526,9 +547,11 @@ function mk_seq_ntc_table_code(ntcs, sequences, title, title_collapsed, tainer_i
ast
=
'
<span class="asterisk">*</span>
'
;
has_unreliable
=
true
;
}
const
fragId
=
mkFragId
(
ntc
,
seq
);
row
+=
`<td class="clickable" id="
${
fragment_cell_id
(
mkFragId
(
ntc
,
seq
),
'
browse
'
)}
" onClick='browse_fragment_clicked(this, "
${
ntc
}
", "
${
seq
}
");'>
${
waterCnt
}${
ast
}
</td>`
;
}
else
}
else
{
row
+=
`<td class="disabled">
${
waterCnt
}
</td>`
;
}
}
row
+=
'
</tr>
'
;
if
(
row_has_nonzero
)
{
...
...
@@ -583,8 +606,6 @@ function fill_zee_table() {
function
fill_browse_table
()
{
const
change_responsive_width
=
(
state
)
=>
{
console
.
log
(
state
);
const
states
=
[
'
collapsed
'
,
'
expanded
'
];
const
classes
=
{
'
collapsed
'
:
[
...
...
@@ -621,7 +642,7 @@ function fill_browse_table() {
'
<div><strong>Table 3:</strong> Number of water molecules for each NtC/sequence category.</div>
'
,
'
<div class="dont-wrap"><strong>Table 3:</strong> ...</div>
'
,
'
browse-fragments-table
'
,
change_responsive_width
[
change_responsive_width
,
mark_selected_in_browse
]
);
PREGENERATED_TABLES
[
'
browse-fragments-table
'
]
=
{
...
...
This diff is collapsed.
Click to expand it.
molstar
@
8616af76
Compare
88b8e745
...
8616af76
Subproject commit 8
8b8e7451fa6887c800befd6beab2bc7e017c499
Subproject commit 8
616af76c0d7d0a5a186d500e9afb4d33adf8863
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment