Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
a4bfcd34
Commit
a4bfcd34
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
when icon is clicked and there is proper searchtab in the panel open it's focused on it
parent
208d814e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!412
changes from 12.1.0~beta.1 into master
,
!406
Resolve "multiple search results - change tabs"
Pipeline
#6434
passed
6 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js
+35
-2
35 additions, 2 deletions
frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js
frontend-js/src/main/js/map/data/IdentifiedElement.js
+1
-1
1 addition, 1 deletion
frontend-js/src/main/js/map/data/IdentifiedElement.js
with
36 additions
and
3 deletions
frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js
+
35
−
2
View file @
a4bfcd34
...
...
@@ -6,6 +6,7 @@ var Promise = require("bluebird");
var
AbstractDbPanel
=
require
(
'
./AbstractDbPanel
'
);
var
Alias
=
require
(
'
../../map/data/Alias
'
);
var
IdentifiedElement
=
require
(
'
../../map/data/IdentifiedElement
'
);
var
InvalidArgumentError
=
require
(
'
../../InvalidArgumentError
'
);
var
PanelControlElementType
=
require
(
'
../PanelControlElementType
'
);
var
Reaction
=
require
(
'
../../map/data/Reaction
'
);
...
...
@@ -22,15 +23,47 @@ var Functions = require('../../Functions');
* @extends AbstractDbPanel
*/
function
GenericSearchPanel
(
params
)
{
var
self
=
this
;
params
.
panelName
=
"
search
"
;
params
.
helpTip
=
"
<p>search tab allows to search for particular elements or interactions in the map</p>
"
+
"
<p>perfect match tick box active: only terms with an exact match to the query will be returned</p>
"
+
"
<p>separate multiple search by semicolon</p>
"
;
params
.
placeholder
=
"
keyword
"
;
AbstractDbPanel
.
call
(
this
,
params
);
AbstractDbPanel
.
call
(
self
,
params
);
self
.
createSearchGui
();
self
.
getMap
().
addListener
(
"
onBioEntityClick
"
,
function
(
e
)
{
var
identifiedElement
=
e
.
arg
;
var
queries
=
self
.
getOverlayDb
().
getQueries
();
var
promises
=
[];
for
(
var
i
=
0
;
i
<
queries
.
length
;
i
++
)
{
promises
.
push
(
self
.
getOverlayDb
().
getElementsByQuery
(
queries
[
i
]));
}
return
Promise
.
all
(
promises
).
then
(
function
(
elements
)
{
var
tab
=
-
1
;
for
(
var
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
elements
[
i
].
length
;
j
++
)
{
var
element
=
elements
[
i
][
j
].
element
;
if
(
element
instanceof
SearchBioEntityGroup
)
{
for
(
var
k
=
0
;
k
<
element
.
getBioEntities
().
length
;
k
++
)
{
if
(
new
IdentifiedElement
(
element
.
getBioEntities
()[
k
]).
equals
(
identifiedElement
))
{
tab
=
i
;
}
}
}
else
if
(
new
IdentifiedElement
(
element
).
equals
(
identifiedElement
))
{
tab
=
i
;
}
}
}
var
link
=
$
(
"
.parentTabs > .nav-tabs > li > a
"
,
self
.
getElement
())[
tab
];
if
(
link
!==
undefined
)
{
return
link
.
click
();
}
});
});
this
.
createSearchGui
();
}
GenericSearchPanel
.
prototype
=
Object
.
create
(
AbstractDbPanel
.
prototype
);
...
...
This diff is collapsed.
Click to expand it.
frontend-js/src/main/js/map/data/IdentifiedElement.js
+
1
−
1
View file @
a4bfcd34
...
...
@@ -267,7 +267,7 @@ IdentifiedElement.prototype.setLineColor = function (lineColor) {
/**
*
* @param {
IdentifiedElemen
t} argument
* @param {
Objec
t} argument
* @returns {boolean}
*/
IdentifiedElement
.
prototype
.
equals
=
function
(
argument
)
{
...
...
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