From 7a8ddb1beb8a1309af2b11d11979d8acaeb6b818 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 16 Jun 2006 07:44:55 +0000 Subject: [PATCH] Fix logic in _noteToTitle in itemPane.js (if no newline in note the title would be "Untitled Note") -- though it'd be better to do what Stickies do and just find the first bit of text, even if it's not on the first line (regex is probably easiest) --- chrome/chromeFiles/content/scholar/itemPane.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/chromeFiles/content/scholar/itemPane.js b/chrome/chromeFiles/content/scholar/itemPane.js index e5efc16228..ccb9642290 100644 --- a/chrome/chromeFiles/content/scholar/itemPane.js +++ b/chrome/chromeFiles/content/scholar/itemPane.js @@ -319,7 +319,12 @@ ScholarItemPane = new function() function _noteToTitle(text) { - var t = text.substring(0, Math.min(text.indexOf("\n"), 30) ); + var t = text.substring(0, 30); + var ln = t.indexOf("\n"); + if (ln>-1 && ln<30) + { + t = t.substring(0, ln); + } if(t == "") {