Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
0a22befd
Commit
0a22befd
authored
Jun 17, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'github/master' into portable
parents
2bcdeca2
c06f487e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+28
-20
No files found.
debomatic-webui/public/javascripts/page_distribution.js
View file @
0a22befd
...
...
@@ -86,6 +86,25 @@ function Page_Distrubion(socket) {
return
true
;
}
var
page
=
{
go
:
{
down
:
function
(
height
)
{
if
(
height
===
undefined
)
height
=
$
(
'
body
'
).
offset
().
top
;
debug
(
2
,
'
scrolling page down - height
'
,
height
);
$
(
'
html,body
'
).
animate
({
scrollTop
:
height
},
0
);
},
up
:
function
()
{
debug
(
2
,
'
scrolling page up
'
);
$
(
'
html,body
'
).
animate
({
scrollTop
:
0
},
0
);
}
}
};
var
title
=
{
set
:
function
(
label
)
{
if
(
label
)
{
...
...
@@ -339,6 +358,13 @@ function Page_Distrubion(socket) {
var
file_content
=
$
(
'
#file pre
'
);
if
(
!
current_file_in_preview
)
{
file_content
.
append
(
new_content
);
if
(
config
.
preferences
.
autoscroll
)
{
// scroll down if file is covering footer
var
file_height
=
$
(
'
#fileOffset
'
).
offset
().
top
;
var
footerOffset
=
$
(
'
footer
'
).
offset
().
top
;
if
(
file_height
>
footerOffset
)
page
.
go
.
down
(
file_height
);
}
}
else
{
// always show only config.file.num_lines lines in preview
var
content
=
file_content
.
html
().
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
);
...
...
@@ -347,18 +373,6 @@ function Page_Distrubion(socket) {
file_content
.
html
(
content
);
file_content
.
scrollTop
(
file_content
[
0
].
scrollHeight
);
}
if
(
config
.
preferences
.
autoscroll
)
{
// scroll down if file is covering footer
var
file_height
=
$
(
'
#fileOffset
'
).
offset
().
top
;
var
footerOffset
=
$
(
'
footer
'
).
offset
().
top
;
if
(
file_height
>
footerOffset
)
{
debug
(
2
,
'
scoll down on new content
'
);
$
(
'
html,body
'
).
animate
({
scrollTop
:
file_height
},
0
);
}
}
},
get
:
function
(
force
)
{
if
(
Utils
.
check_view_file
(
view
))
{
...
...
@@ -678,9 +692,7 @@ function Page_Distrubion(socket) {
view
.
package
=
Utils
.
clone
(
view
.
packages
[
new_view
.
package
.
orig_name
]);
view
.
file
=
Utils
.
clone
(
new_view
.
file
);
update
.
page
(
old_view
);
$
(
'
html,body
'
).
animate
({
scrollTop
:
0
},
0
);
page
.
go
.
up
();
debug
(
1
,
'
changing view
'
,
'
old:
'
,
old_view
,
'
new:
'
,
view
);
});
...
...
@@ -689,11 +701,7 @@ function Page_Distrubion(socket) {
populate
();
// Init sticky-package back_on_top on click
$
(
'
#sticky-package
'
).
on
(
'
click
'
,
function
()
{
$
(
'
html,body
'
).
animate
({
scrollTop
:
0
},
100
);
});
$
(
'
#sticky-package
'
).
on
(
'
click
'
,
page
.
go
.
up
);
// WORKAROUND:
// when page is loaded sidebar has offset().top
...
...
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