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

View File

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

View File

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