Commit 18e7dbb1 authored by Leo Iannacone's avatar Leo Iannacone

try to run without WARKAROUND watch_for_new_lines()

parent ad5866e1
...@@ -68,7 +68,6 @@ function Page_Distrubion(socket) { ...@@ -68,7 +68,6 @@ function Page_Distrubion(socket) {
var _e = config.events.client; var _e = config.events.client;
var view = Utils.from_hash_to_view(); var view = Utils.from_hash_to_view();
var sidebarOffset = 0; var sidebarOffset = 0;
var new_lines = [];
var current_file_in_preview = false; var current_file_in_preview = false;
function __check_hash_makes_sense() { function __check_hash_makes_sense() {
...@@ -584,7 +583,7 @@ function Page_Distrubion(socket) { ...@@ -584,7 +583,7 @@ function Page_Distrubion(socket) {
socket.on(_e.file_newcontent, function (socket_data) { socket.on(_e.file_newcontent, function (socket_data) {
debug_socket('received', _e.file_newcontent, socket_data); debug_socket('received', _e.file_newcontent, socket_data);
new_lines.push(socket_data.file.new_content); file.append(socket_data.file.new_content);
}); });
$(window).on('hashchange', function () { $(window).on('hashchange', function () {
...@@ -622,18 +621,6 @@ function Page_Distrubion(socket) { ...@@ -622,18 +621,6 @@ function Page_Distrubion(socket) {
// events. Sleep a while and call stiky.reset() // events. Sleep a while and call stiky.reset()
setTimeout(sticky.reset, 500); 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 // Update html according with preferences
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