[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.
This commit is contained in:
David Norton 2006-06-16 15:15:42 +00:00
parent 8ff6c48001
commit 3cdcf3093a
2 changed files with 10 additions and 5 deletions

View file

@ -272,7 +272,7 @@ ScholarItemPane = new function()
return; return;
var id = _selectedNoteID(); var id = _selectedNoteID();
if(id && id != "undefined") if(id)
{ {
_itemBeingEdited.updateNote(id,_notesField.value); _itemBeingEdited.updateNote(id,_notesField.value);
} }
@ -283,14 +283,18 @@ ScholarItemPane = new function()
} }
var label = _noteToTitle(_notesField.value); var label = _noteToTitle(_notesField.value);
_notesMenu.selectedItem.setAttribute('label', label); _notesMenu.selectedItem.label = label;
_notesMenu.setAttribute('label', label); _notesMenu.setAttribute('label', label);
} }
function removeSelectedNote() function removeSelectedNote()
{ {
if(_notesField.value != "")
if(!confirm("Are you sure you want to delete the selected note?"))
return;
var id = _selectedNoteID(); var id = _selectedNoteID();
if(id && id != "undefined") if(id)
{ {
_itemBeingEdited.removeNote(id); _itemBeingEdited.removeNote(id);
} }
@ -313,7 +317,7 @@ ScholarItemPane = new function()
function addNote() function addNote()
{ {
modifySelectedNote(); modifySelectedNote();
_notesMenu.appendItem('Untitled Note'); _notesMenu.appendItem('Untitled Note',null);
_notesMenu.selectedIndex = _notesMenu.firstChild.childNodes.length-1; _notesMenu.selectedIndex = _notesMenu.firstChild.childNodes.length-1;
onNoteSelected(); onNoteSelected();
@ -326,7 +330,7 @@ ScholarItemPane = new function()
Scholar.debug(id); Scholar.debug(id);
if(id && id != "undefined") if(id)
_notesField.value = _itemBeingEdited.getNote(id); _notesField.value = _itemBeingEdited.getNote(id);
else else
_notesField.value = ""; _notesField.value = "";

View file

@ -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.isSeparator = function(row) { return false; }
Scholar.ItemTreeView.prototype.isContainer = function(row) { return false; } Scholar.ItemTreeView.prototype.isContainer = function(row) { return false; }
Scholar.ItemTreeView.prototype.getLevel = function(row) { return 0; } Scholar.ItemTreeView.prototype.getLevel = function(row) { return 0; }