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
cc7107dc
Commit
cc7107dc
authored
Mar 12, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added workaround for houndred of new_lines at second
parent
379f1159
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+21
-4
No files found.
debomatic-webui/public/javascripts/page_distribution.js
View file @
cc7107dc
...
@@ -4,6 +4,7 @@ function Page_Distrubion(socket)
...
@@ -4,6 +4,7 @@ function Page_Distrubion(socket)
var
events
=
config
.
events
.
client
var
events
=
config
.
events
.
client
var
data
=
Utils
.
from_hash_to_data
()
var
data
=
Utils
.
from_hash_to_data
()
var
sidebarOffset
=
0
var
sidebarOffset
=
0
var
new_lines
=
[]
function
__check_hash_makes_sense
()
{
function
__check_hash_makes_sense
()
{
if
(
!
window
.
location
.
hash
)
if
(
!
window
.
location
.
hash
)
...
@@ -145,9 +146,9 @@ function Page_Distrubion(socket)
...
@@ -145,9 +146,9 @@ function Page_Distrubion(socket)
$
(
'
#file pre
'
).
html
(
''
)
$
(
'
#file pre
'
).
html
(
''
)
$
(
'
#file
'
).
hide
()
$
(
'
#file
'
).
hide
()
},
},
append
:
function
(
data
)
{
append
:
function
(
new_content
)
{
var
content
=
$
(
"
#file pre
"
)
var
content
=
$
(
"
#file pre
"
)
content
.
html
(
content
.
html
()
+
data
.
file
.
new_content
)
content
.
html
(
content
.
html
()
+
new_content
)
if
(
config
.
autoscroll
)
{
if
(
config
.
autoscroll
)
{
// scroll down if file is covering footer
// scroll down if file is covering footer
...
@@ -308,7 +309,7 @@ function Page_Distrubion(socket)
...
@@ -308,7 +309,7 @@ function Page_Distrubion(socket)
})
})
socket
.
on
(
events
.
file_newcontent
,
function
(
socket_data
)
{
socket
.
on
(
events
.
file_newcontent
,
function
(
socket_data
)
{
file
.
append
(
socket_data
)
new_lines
.
push
(
socket_data
.
file
.
new_content
)
})
})
$
(
window
).
on
(
'
hashchange
'
,
function
()
{
$
(
window
).
on
(
'
hashchange
'
,
function
()
{
...
@@ -321,8 +322,24 @@ function Page_Distrubion(socket)
...
@@ -321,8 +322,24 @@ function Page_Distrubion(socket)
$
(
window
).
on
(
'
load
'
,
function
()
{
$
(
window
).
on
(
'
load
'
,
function
()
{
__check_hash_makes_sense
()
__check_hash_makes_sense
()
populate
()
populate
()
// FIXME: workaround for sticky.start() on page load and offset is 0
// WORKAROUND:
// when page is loaded sidebar has offset().top
// equals 0. This is why html will be loaded on socket
// events. Sleep a while and call stiky.reset()
this
.
setTimeout
(
sticky
.
reset
,
500
);
this
.
setTimeout
(
sticky
.
reset
,
500
);
// WORKAOUND:
// On incoming hundred of lines browser goes crazy.
// Append lines only on a timeout.
function
watch_for_new_lines
()
{
if
(
new_lines
.
length
>
0
)
{
file
.
append
(
new_lines
.
join
(
''
))
new_lines
=
[]
}
setTimeout
(
watch_for_new_lines
,
200
);
}
watch_for_new_lines
()
});
});
}
}
...
...
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