Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
2563dd32
Commit
2563dd32
authored
Feb 08, 2019
by
flothoni
Browse files
model.js; optimize getColorSelectedClone, use Set object
link to
#3697
parent
4aa2443e
Pipeline
#62859
passed with stages
in 4 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
browser/js/model.js
View file @
2563dd32
...
...
@@ -890,6 +890,7 @@ changeAlleleNotation: function(alleleNotation) {
*/
colorize_multitag_star_icon
:
function
(){
var
color
=
this
.
getColorSelectedClone
()
try
{
// put it in a try to not create errors on qunit
var
div
=
document
.
getElementById
(
"
tag_icon__multiple
"
)
...
...
@@ -910,21 +911,23 @@ changeAlleleNotation: function(alleleNotation) {
*/
getColorSelectedClone
:
function
(){
var
selected
=
this
.
getSelected
()
var
list_color
=
[]
var
list_color
=
new
Set
()
if
(
selected
.
length
==
0
){
return
false
}
for
(
var
i
=
0
;
i
<
selected
.
length
;
i
++
)
{
var
clone_id
=
selected
[
i
]
var
clone
=
this
.
clones
[
clone_id
]
var
color
=
clone
.
true_color
;
list_color
.
push
(
color
)
list_color
.
add
(
color
)
if
(
list_color
.
size
==
2
){
return
false
}
}
var
setted_list
=
Array
.
from
(
new
Set
(
list_color
)
)
if
(
setted_list
.
length
==
1
)
{
return
setted_list
[
0
]
}
else
{
return
false
}
return
Array
.
from
(
list_color
)[
0
]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment