Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a29eaffa
authored
Mar 05, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: toggle toplist
fixes #37
parent
717a6607
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
one/static/script/store.js
+22
-2
one/templates/box/file/box.html
+1
-1
No files found.
one/static/script/store.js
View file @
a29eaffa
...
...
@@ -113,7 +113,27 @@ var cloud = (function(cloud) {
})
});
self
.
loadTopList
=
cloud
.
throttle
(
function
()
{
var
showToplist
=
ko
.
observable
(
false
);
self
.
toggleToplist
=
cloud
.
throttle
(
function
()
{
if
(
!
showToplist
())
{
showToplist
(
true
);
loadToplist
();
}
else
{
showToplist
(
false
);
self
.
currentPath
(
'/'
);
loadFolder
(
'/'
);
}
});
self
.
getToplistText
=
ko
.
computed
(
function
()
{
if
(
!
showToplist
())
{
return
gettext
(
'Toplist'
);
}
else
{
return
gettext
(
'Back to the root folder'
)
}
})
function
loadToplist
()
{
self
.
currentPath
(
'/'
);
$
.
ajax
({
type
:
'POST'
,
...
...
@@ -136,7 +156,7 @@ var cloud = (function(cloud) {
});
}
})
}
);
}
/**
* After loadFolder completes, this function updates the UI
...
...
one/templates/box/file/box.html
View file @
a29eaffa
...
...
@@ -86,7 +86,7 @@
</li>
<li
class=
"entry small-row"
>
<div
class=
"summary"
id=
"new-folder"
>
<div
class=
"name toplist"
data-bind=
"click:
loadTopList"
>
{% trans "Toplist" %}
</div>
<div
class=
"name toplist"
data-bind=
"click:
toggleToplist, text: getToplistText"
>
</div>
<div
class=
"clear"
></div>
</div>
</li>
...
...
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