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
c06f487e
Commit
c06f487e
authored
Jun 17, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
defined page object to scroll up/down window - do not scroll if file is in preview
parent
a506e2a6
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 @
c06f487e
...
@@ -86,6 +86,25 @@ function Page_Distrubion(socket) {
...
@@ -86,6 +86,25 @@ function Page_Distrubion(socket) {
return
true
;
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
=
{
var
title
=
{
set
:
function
(
label
)
{
set
:
function
(
label
)
{
if
(
label
)
{
if
(
label
)
{
...
@@ -339,6 +358,13 @@ function Page_Distrubion(socket) {
...
@@ -339,6 +358,13 @@ function Page_Distrubion(socket) {
var
file_content
=
$
(
'
#file pre
'
);
var
file_content
=
$
(
'
#file pre
'
);
if
(
!
current_file_in_preview
)
{
if
(
!
current_file_in_preview
)
{
file_content
.
append
(
new_content
);
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
{
}
else
{
// always show only config.file.num_lines lines in preview
// always show only config.file.num_lines lines in preview
var
content
=
file_content
.
html
().
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
);
var
content
=
file_content
.
html
().
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
);
...
@@ -347,18 +373,6 @@ function Page_Distrubion(socket) {
...
@@ -347,18 +373,6 @@ function Page_Distrubion(socket) {
file_content
.
html
(
content
);
file_content
.
html
(
content
);
file_content
.
scrollTop
(
file_content
[
0
].
scrollHeight
);
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
)
{
get
:
function
(
force
)
{
if
(
Utils
.
check_view_file
(
view
))
{
if
(
Utils
.
check_view_file
(
view
))
{
...
@@ -678,9 +692,7 @@ function Page_Distrubion(socket) {
...
@@ -678,9 +692,7 @@ function Page_Distrubion(socket) {
view
.
package
=
Utils
.
clone
(
view
.
packages
[
new_view
.
package
.
orig_name
]);
view
.
package
=
Utils
.
clone
(
view
.
packages
[
new_view
.
package
.
orig_name
]);
view
.
file
=
Utils
.
clone
(
new_view
.
file
);
view
.
file
=
Utils
.
clone
(
new_view
.
file
);
update
.
page
(
old_view
);
update
.
page
(
old_view
);
$
(
'
html,body
'
).
animate
({
page
.
go
.
up
();
scrollTop
:
0
},
0
);
debug
(
1
,
'
changing view
'
,
'
old:
'
,
old_view
,
'
new:
'
,
view
);
debug
(
1
,
'
changing view
'
,
'
old:
'
,
old_view
,
'
new:
'
,
view
);
});
});
...
@@ -689,11 +701,7 @@ function Page_Distrubion(socket) {
...
@@ -689,11 +701,7 @@ function Page_Distrubion(socket) {
populate
();
populate
();
// Init sticky-package back_on_top on click
// Init sticky-package back_on_top on click
$
(
'
#sticky-package
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#sticky-package
'
).
on
(
'
click
'
,
page
.
go
.
up
);
$
(
'
html,body
'
).
animate
({
scrollTop
:
0
},
100
);
});
// WORKAROUND:
// WORKAROUND:
// when page is loaded sidebar has offset().top
// 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