Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
dffcab0a
Commit
dffcab0a
authored
Jan 16, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add possibility to close (remove) 'refine' filters
parent
ba7989f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
4 deletions
+44
-4
whoswho.css
static/css/whoswho.css
+18
-0
whoswho.js
static/js/whoswho.js
+26
-4
No files found.
static/css/whoswho.css
View file @
dffcab0a
...
...
@@ -218,8 +218,26 @@ input.name {
padding
:
0
!important
;
padding
:
0
!important
;
margin
:
.25em
0
0
0
!important
;
-webkit-transition
:
opacity
.5s
ease-in
;
}
.filter
>
span
{
padding
0
0
1em
0
!important
;
/*margin: 0 0 1em 0 !important;*/
}
.filter-close
{
font-family
:
sans-serif
;
font-weight
:
bolder
;
font-size
:
1em
;
position
:
relative
;
margin-top
:
-.3em
;
margin-right
:
1em
;
float
:
right
;
color
:
#23A
;
background-color
:
#979797
;
border-radius
:
1em
;
padding
:
0
.4em
;
cursor
:
pointer
;
opacity
:
1
;
}
static/js/whoswho.js
View file @
dffcab0a
...
...
@@ -25,7 +25,7 @@ completion = {};
gexf
=
""
;
$
(
document
).
ready
(
function
()
{
var
cache
,
collectFilters
,
loadGraph
,
popfilter
,
xhrs
;
var
cache
,
c
loseBox
,
c
ollectFilters
,
loadGraph
,
popfilter
,
xhrs
;
log
(
"document ready.. installing whoswho"
);
loadGraph
=
function
(
g
)
{
gexf
=
g
;
...
...
@@ -38,17 +38,38 @@ $(document).ready(function() {
}
};
// small filter closing function
closeThisBox
=
function
()
{
var
targetId
=
this
.
getAttribute
(
"for"
)
if
(
targetId
)
{
var
tgtBox
=
document
.
getElementById
(
targetId
)
// start transition
tgtBox
.
style
.
opacity
=
0
// remove box
setTimeout
(
function
(){
tgtBox
.
remove
()},
500
)
return
true
}
else
{
console
.
warn
(
'closeThisBox: no @for attribute!'
)
return
false
}
}
// autocomplete
popfilter
=
function
(
label
,
type
,
options
)
{
var
footer
,
header
,
id
,
id1
,
id2
,
input
,
labelization
;
var
footer
,
header
,
id
,
id1
,
id2
,
input
,
closebox
,
labelization
;
id
=
ids
++
;
id1
=
"filter"
+
id
;
id2
=
"combo"
+
id
;
id3
=
"close"
+
id
;
header
=
"<li id=
\"
"
+
id1
+
"
\"
class=
\"
filter
\"
style=
\"
padding-top: 5px;
\"
>"
;
labelization
=
"<span style=
\"
color: #fff;
\"
> "
+
label
+
" </span>"
;
input
=
"<input type=
\"
text
\"
id=
\"
"
+
id2
+
"
\"
class=
\"
medium filter"
+
type
+
"
\"
placeholder=
\"
"
+
type
+
"
\"
/>"
;
closebox
=
"<div id=
\"
"
+
id3
+
"
\"
for=
\"
"
+
id1
+
"
\"
class=
\"
filter-close operation
\"
>x</div>"
footer
=
"</li>;"
;
$
(
header
+
labelization
+
input
+
footer
).
insertBefore
(
"#refine"
);
$
(
header
+
labelization
+
input
+
closebox
+
footer
).
insertBefore
(
"#refine"
);
$
(
'#'
+
id3
).
click
(
closeThisBox
)
console
.
log
(
"whoswho.popfilter: adding autocomplete menu"
,
$
(
"#"
+
id1
))
...
...
@@ -187,6 +208,7 @@ $(document).ready(function() {
}
});
// main form collect function
collectFilters
=
function
(
cb
)
{
var
collect
,
query
;
...
...
@@ -200,7 +222,7 @@ $(document).ready(function() {
console
.
log
(
'collecting (filter '
+
k
+
') from elt:'
+
e
)
value
=
$
(
e
).
val
();
if
(
value
!=
null
)
{
if
(
value
!=
null
&&
value
!=
""
)
{
log
(
"got: "
+
value
);
value
=
$
.
trim
(
value
);
log
(
"sanitized: "
+
value
);
...
...
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