Commit 203ed11b authored by Leo Iannacone's avatar Leo Iannacone

Revert "try to run without WARKAROUND watch_for_new_lines()"

This reverts commit 18e7dbb1.
parent 69737357
......@@ -68,6 +68,7 @@ function Page_Distrubion(socket) {
var _e = config.events.client;
var view = Utils.from_hash_to_view();
var sidebarOffset = 0;
var new_lines = [];
var current_file_in_preview = false;
function __check_hash_makes_sense() {
......@@ -611,7 +612,7 @@ function Page_Distrubion(socket) {
socket.on(_e.file_newcontent, function (socket_data) {
debug_socket('received', _e.file_newcontent, socket_data);
file.append(socket_data.file.new_content);
new_lines.push(socket_data.file.new_content);
});
$(window).on('hashchange', function () {
......@@ -649,6 +650,18 @@ function Page_Distrubion(socket) {
// events. Sleep a while and call stiky.reset()
setTimeout(sticky.reset, 500);
// WORKAROUND:
// On incoming hundred of lines browser goes crazy.
// Append lines every 200 mills.
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();
// Update html according with preferences
preferences();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment