Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rishabh Gupta
purr-data
Commits
973be479
Commit
973be479
authored
Oct 31, 2017
by
Jonathan Wilkes
Browse files
Merge branch 'throttle-console-scroll'
parents
89f3dc8b
281406e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
973be479
...
...
@@ -491,6 +491,20 @@ function set_audioapi(val) {
pd_whichapi
=
val
;
}
var
throttle_console_scroll
=
(
function
()
{
var
scroll_delay
;
return
function
()
{
if
(
!
scroll_delay
)
{
scroll_delay
=
setTimeout
(
function
()
{
var
printout
=
pd_window
.
document
.
getElementById
(
"
console_bottom
"
);
printout
.
scrollTop
=
printout
.
scrollHeight
;
scroll_delay
=
undefined
;
},
30
);
}
}
}());
// Hmm, probably need a closure here...
var
current_string
=
""
;
var
last_string
=
""
;
...
...
@@ -518,13 +532,14 @@ function do_post(string, type) {
text
=
pd_window
.
document
.
createTextNode
(
current_string
);
span
.
appendChild
(
text
);
myp
.
appendChild
(
span
);
printout
=
pd_window
.
document
.
getElementById
(
"
console_bottom
"
);
printout
.
scrollTop
=
printout
.
scrollHeight
;
last_string
=
current_string
;
current_string
=
""
;
last_child
=
span
;
last_object_id
=
""
;
duplicate
=
0
;
// update the scrollbars to the bottom, but throttle it
// since it is expensive
throttle_console_scroll
();
}
}
}
...
...
@@ -5234,7 +5249,7 @@ function canvas_params(cid)
}
function
do_getscroll
(
cid
)
{
// Since we're
debounc
ing these getscroll calls, they can happen after
// Since we're
throttl
ing these getscroll calls, they can happen after
// the patch has been closed. We remove the cid from the patchwin
// object on close, so we can just check to see if our Window object has
// been set to null, and if so just return.
...
...
Write
Preview
Supports
Markdown
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