From 3cdcf3093a3163581e282328ac563edef1a5df5b Mon Sep 17 00:00:00 2001 From: David Norton Date: Fri, 16 Jun 2006 15:15:42 +0000 Subject: [PATCH] [interface] Confirms delete of note [fix] Minor fix - no more exception on ItemTreeView when you hit the left or right arrow [ignore] simplified some checking in the note code. --- chrome/chromeFiles/content/scholar/itemPane.js | 14 +++++++++----- chrome/chromeFiles/content/scholar/itemTreeView.js | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/itemPane.js b/chrome/chromeFiles/content/scholar/itemPane.js index 6657c0cfa6..4f92300632 100644 --- a/chrome/chromeFiles/content/scholar/itemPane.js +++ b/chrome/chromeFiles/content/scholar/itemPane.js @@ -272,7 +272,7 @@ ScholarItemPane = new function() return; var id = _selectedNoteID(); - if(id && id != "undefined") + if(id) { _itemBeingEdited.updateNote(id,_notesField.value); } @@ -283,14 +283,18 @@ ScholarItemPane = new function() } var label = _noteToTitle(_notesField.value); - _notesMenu.selectedItem.setAttribute('label', label); + _notesMenu.selectedItem.label = label; _notesMenu.setAttribute('label', label); } function removeSelectedNote() { + if(_notesField.value != "") + if(!confirm("Are you sure you want to delete the selected note?")) + return; + var id = _selectedNoteID(); - if(id && id != "undefined") + if(id) { _itemBeingEdited.removeNote(id); } @@ -313,7 +317,7 @@ ScholarItemPane = new function() function addNote() { modifySelectedNote(); - _notesMenu.appendItem('Untitled Note'); + _notesMenu.appendItem('Untitled Note',null); _notesMenu.selectedIndex = _notesMenu.firstChild.childNodes.length-1; onNoteSelected(); @@ -326,7 +330,7 @@ ScholarItemPane = new function() Scholar.debug(id); - if(id && id != "undefined") + if(id) _notesField.value = _itemBeingEdited.getNote(id); else _notesField.value = ""; diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js index c6e11269f8..05078f354e 100644 --- a/chrome/chromeFiles/content/scholar/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/itemTreeView.js @@ -438,6 +438,7 @@ Scholar.ItemTreeView.prototype.onDragOver = function (evt,dropdata,session) { } /// //////////////////////////////////////////////////////////////////////////////// +Scholar.ItemTreeView.prototype.getParentIndex = function(row) { return -1; } Scholar.ItemTreeView.prototype.isSeparator = function(row) { return false; } Scholar.ItemTreeView.prototype.isContainer = function(row) { return false; } Scholar.ItemTreeView.prototype.getLevel = function(row) { return 0; }