[interface] All editing elements that look like labels but provide functionality now offer hover feedback

[fix] You shouldn't lose your changes if you select another item in the middle of editing a field.
[fix] The dropdown menu to select notes doesn't steal the focus
This commit is contained in:
David Norton 2006-06-16 17:21:30 +00:00
parent 380584986a
commit bf0626cb58
3 changed files with 16 additions and 6 deletions

View file

@ -54,6 +54,9 @@ ScholarItemPane = new function()
if(_itemBeingEdited && thisItem.getID() == _itemBeingEdited.getID())
return;
if(document.commandDispatcher.focusedElement)
document.commandDispatcher.focusedElement.blur();
_itemBeingEdited = thisItem;
reloadFields();
@ -135,6 +138,7 @@ ScholarItemPane = new function()
label.setAttribute("value",Scholar.getString('creatorTypes.'+Scholar.CreatorTypes.getTypeName(typeID))+":");
label.setAttribute("popup","creatorTypeMenu");
label.setAttribute("fieldname",'creator-'+_creatorCount+'-typeID');
label.className = 'clicky';
var row = document.createElement("hbox");
@ -146,13 +150,13 @@ ScholarItemPane = new function()
var removeButton = document.createElement('label');
removeButton.setAttribute("value","-");
removeButton.setAttribute("class","addremove");
removeButton.setAttribute("class","clicky");
removeButton.setAttribute("onclick","ScholarItemPane.removeCreator("+_creatorCount+")");
row.appendChild(removeButton);
var addButton = document.createElement('label');
addButton.setAttribute("value","+");
addButton.setAttribute("class","addremove");
addButton.setAttribute("class","clicky");
addButton.setAttribute("onclick","ScholarItemPane.addCreatorRow('','',1);");
row.appendChild(addButton);
@ -168,6 +172,7 @@ ScholarItemPane = new function()
{
valueElement.setAttribute('fieldname',fieldName);
valueElement.setAttribute('onclick', 'ScholarItemPane.showEditor(this);');
valueElement.className = 'clicky';
}
var firstSpace = valueText.indexOf(" ");

View file

@ -17,8 +17,8 @@
<menulist flex="1" id="scholar-notes-menu" oncommand="ScholarItemPane.onNoteSelected();">
<menupopup/>
</menulist>
<toolbarbutton label="-" class="addremove" oncommand="ScholarItemPane.removeSelectedNote();"/>
<toolbarbutton label="+" class="addremove" oncommand="ScholarItemPane.addNote();"/>
<label value="-" class="clicky" onclick="ScholarItemPane.removeSelectedNote();"/>
<label value="+" class="clicky" onclick="ScholarItemPane.addNote();"/>
</hbox>
<textbox id="scholar-notes-field"
type="timed" timeout="1000" oncommand="ScholarItemPane.modifySelectedNote();"

View file

@ -62,12 +62,17 @@ tree #items-tree
overflow: auto;
}
#scholar-metadata .addremove
#scholar-notes-menu
{
-moz-user-focus: ignore;
}
#scholar-view-item .clicky
{
-moz-border-radius: 6px;
}
#scholar-metadata .addremove:hover
#scholar-view-item .clicky:hover
{
color: white;
background: #666666;