See ChangeLog

Monotone-Parent: 3bcf335dfec03346a40495ed251c4c99d8b3890f
Monotone-Revision: fb988c964ef041fc784d33b6c0cf192735fe88a0

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-06-16T20:21:38
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-06-16 20:21:38 +00:00
parent 922c760c95
commit 98df4f0682
4 changed files with 40 additions and 1 deletions
+2 -1
View File
@@ -191,9 +191,10 @@ var SOGoAutoCompletionInterface = {
}
// Show popup menu
var div = Element.up(input, 'DIV');
var offsetScroll = Element.cumulativeScrollOffset(input);
var offset = Element.positionedOffset(input);
if (offset.top < 50)
if (div.getStyle('position') == 'relative')
// Hack for some situations where the offset must be computed differently
offset = Element.cumulativeOffset(input);
var top = offset.top - offsetScroll.top + node.offsetHeight + 3;
+13
View File
@@ -136,6 +136,17 @@ function onEditorSubmitClick(event) {
this.blur();
}
function onDocumentKeydown(event) {
var target = Event.element(event);
if (target.tagName == "INPUT" || target.tagName == "SELECT") {
if (event.keyCode == Event.KEY_RETURN) {
var fcn = onEditorSubmitClick.bind($("submitButton"));
fcn();
Event.stop(event);
}
}
}
function initEditorForm() {
var tabsContainer = $("editorTabs");
var controller = new SOGoTabsController();
@@ -148,6 +159,8 @@ function initEditorForm() {
$("cancelButton").observe("click", onEditorCancelClick);
$("submitButton").observe("click", onEditorSubmitClick);
Event.observe(document, "keydown", onDocumentKeydown);
}
document.observe("dom:loaded", initEditorForm);
+12
View File
@@ -140,6 +140,16 @@ function onEditorSubmitClick(event) {
$("mainForm").submit();
}
function onDocumentKeydown(event) {
var target = Event.element(event);
if (target.tagName == "INPUT") {
if (event.keyCode == Event.KEY_RETURN && target.menu == null) {
onEditorSubmitClick(event);
Event.stop(event);
}
}
}
function initListEditor() {
var table = $("referenceList");
table.multiselect = true;
@@ -148,6 +158,8 @@ function initListEditor() {
$("referenceDelete").observe("click", onReferenceDelete);
$("cancelButton").observe("click", onEditorCancelClick);
$("submitButton").observe("click", onEditorSubmitClick);
Event.observe(document, "keydown", onDocumentKeydown);
}
document.observe("dom:loaded", initListEditor);