Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
17f0360b
authored
Mar 04, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: hide box if needed
fixes
#74
parent
8a338830
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
3 deletions
+60
-3
one/static/script/cloud.js
+50
-2
one/static/style/box.less
+10
-1
No files found.
one/static/script/cloud.js
View file @
17f0360b
...
@@ -400,9 +400,57 @@ $(function() {
...
@@ -400,9 +400,57 @@ $(function() {
function
hidden_group_count
()
{
function
hidden_group_count
()
{
var
hidden_groups
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'hidden_groups'
))
||
{};
var
hidden_groups
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'hidden_groups'
))
||
{};
return
(
hidden_groups
[
current_user
]
||
[]).
length
;
return
(
hidden_groups
[
current_user
]
||
[]).
length
;
}
}
if
(
hidden_group_count
()
==
0
)
{
function
toggle_box
(
id
)
{
var
boxes
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'hidden_boxes'
))
||
{};
var
user_boxes
=
boxes
[
current_user
]
||
[];
for
(
var
i
in
user_boxes
)
{
var
box
=
user_boxes
[
i
];
if
(
box
==
id
)
{
user_boxes
.
splice
(
i
,
1
);
boxes
[
current_user
]
=
user_boxes
;
window
.
localStorage
.
setItem
(
'hidden_boxes'
,
JSON
.
stringify
(
boxes
));
$
(
'#toggle-box-'
+
id
).
attr
(
'src'
,
'/static/icons/eye-half.png'
);
$
(
'#toggle-box-'
+
id
).
parent
().
parent
().
parent
().
next
().
slideDown
(
700
);
return
;
}
}
user_boxes
.
push
(
id
);
boxes
[
current_user
]
=
user_boxes
;
$
(
'#toggle-box-'
+
id
).
attr
(
'src'
,
'/static/icons/eye.png'
);
$
(
'#toggle-box-'
+
id
).
parent
().
parent
().
parent
().
next
().
slideUp
(
700
);
console
.
log
(
$
(
'#toggle-box-'
+
id
).
parent
().
parent
().
parent
().
next
()[
0
])
window
.
localStorage
.
setItem
(
'hidden_boxes'
,
JSON
.
stringify
(
boxes
));
}
function
box_hidden
(
id
)
{
var
boxes
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'hidden_boxes'
))
||
{};
var
user_boxes
=
boxes
[
current_user
]
||
[];
for
(
var
i
in
user_boxes
)
{
var
box
=
user_boxes
[
i
];
if
(
box
==
id
)
{
return
true
;
}
}
return
false
;
}
$
(
'.toggle-box'
).
each
(
function
(){
var
id
=
$
(
this
).
data
(
'id'
);
$
(
this
).
click
(
function
(){
toggle_box
(
id
);
});
if
(
box_hidden
(
id
)){
$
(
this
).
attr
(
'src'
,
'/static/icons/eye.png'
);
$
(
this
).
parent
().
parent
().
parent
().
next
().
hide
();
}
else
{
$
(
this
).
attr
(
'src'
,
'/static/icons/eye-half.png'
);
}
})
if
(
hidden_group_count
()
==
0
)
{
$
(
'#show-hidden-groups'
).
hide
();
$
(
'#show-hidden-groups'
).
hide
();
}
}
...
...
one/static/style/box.less
View file @
17f0360b
...
@@ -645,13 +645,22 @@ table {
...
@@ -645,13 +645,22 @@ table {
margin:20px;
margin:20px;
display: none;
display: none;
}
}
&
:hover .boxhelp-box {
.help
:hover .boxhelp-box {
display: block;
display: block;
}
}
.help {
img {
cursor: default;
}
}
.icon {
.icon {
display: block;
display: block;
float: right;
float: right;
}
}
img {
margin: 3px;
cursor: pointer;
}
}
}
#new-owner-autocomplete {
#new-owner-autocomplete {
...
...
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