From b68b07c687d515668231a229762eebce6154a960 Mon Sep 17 00:00:00 2001 From: Goran Topic Date: Thu, 16 Feb 2012 21:37:29 +0900 Subject: [PATCH] Fixes #718 (file browser OK button fiasco) --- client/src/visualizer.js | 6 +++--- client/src/visualizer_ui.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/visualizer.js b/client/src/visualizer.js index fe31fd8fa..f2b5f4149 100644 --- a/client/src/visualizer.js +++ b/client/src/visualizer.js @@ -409,12 +409,12 @@ var Visualizer = (function($, window, undefined) { // 'focus' : set by URL // (see setMarked() invocations below) - data.markedSent = []; + data.markedSent = {}; markedText = []; var setMarked = function(markedType) { $.each(args[markedType] || [], function(markedNo, marked) { if (marked[0] == 'sent') { - data.markedSent.push(parseInt(marked[1], 10)); + data.markedSent[marked[1]] = true; } else if (marked[0] == 'equiv') { // [equiv, Equiv, T1] $.each(data.equivs, function(equivNo, equiv) { if (equiv[1] == marked[1]) { @@ -1818,7 +1818,7 @@ Util.profileStart('rows'); } rowBox.height += rowPadding; var bgClass; - if ($.inArray(currentSent, data.markedSent) != -1) { + if (data.markedSent[currentSent]) { // specifically highlighted bgClass = 'backgroundHighlight'; } else if (Configuration.textBackgrounds == "striped") { diff --git a/client/src/visualizer_ui.js b/client/src/visualizer_ui.js index f9411e81a..a5274d02c 100644 --- a/client/src/visualizer_ui.js +++ b/client/src/visualizer_ui.js @@ -509,6 +509,7 @@ var VisualizerUI = (function($, window, undefined) { val(). replace(/\/?\s+$/, ''). replace(/^\s+/, ''); + if (!input.length) return false; if (input.substr(0, 2) === '..') { // .. var pos = coll.substr(0, coll.length - 1).lastIndexOf('/');