[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:
parent
8ff6c48001
commit
3cdcf3093a
2 changed files with 10 additions and 5 deletions
|
@ -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 = "";
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue