Monotone-Parent: c1039e97ecb95a8e1dd4a1ca25d457f206daeac3

Monotone-Revision: f4831aba087ab84c9ea8408610dcf9769966b8b8

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-10-18T17:18:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-10-18 17:18:48 +00:00
parent 41b41137bc
commit 2bcbf95a3b
4 changed files with 26 additions and 8 deletions

View File

@@ -127,12 +127,12 @@ Element.addMethods({
var menuTop = Event.pointerY(event);
var menuLeft = Event.pointerX(event);
var heightDiff = (window.innerHeight
var heightDiff = (window.height()
- (menuTop + popup.offsetHeight));
if (heightDiff < 0)
menuTop += heightDiff;
var leftDiff = (window.innerWidth
var leftDiff = (window.width()
- (menuLeft + popup.offsetWidth));
if (leftDiff < 0)
menuLeft -= popup.offsetWidth;
@@ -148,7 +148,8 @@ Element.addMethods({
attachMenu: function(element, menuName) {
element = $(element);
element.sogoContextMenu = $(menuName);
Event.observe(element, "contextmenu", element.onContextMenu.bindAsEventListener(element));
Event.observe(element, "contextmenu",
element.onContextMenu.bindAsEventListener(element));
},
select: function(element) {

View File

@@ -351,3 +351,21 @@ String.prototype.cssSafeString = function() {
return newString;
}
window.width = function() {
if (window.innerWidth)
return window.innerWidth;
else if (document.body && document.body.offsetWidth)
return document.body.offsetWidth;
else
return 0;
}
window.height = function() {
if (window.innerHeight)
return window.innerHeight;
else if (document.body && document.body.offsetHeight)
return document.body.offsetHeight;
else
return 0;
}

View File

@@ -99,8 +99,8 @@ function showCoords(node) {
node = $("givenName");
window.alert("x: " + node.cascadeLeftOffset()
+ ";y: " + node.cascadeTopOffset()
+ ";width: " + window.innerWidth
+ ";height: " + window.innerHeight);
+ ";width: " + window.width()
+ ";height: " + window.height());
}
function onFnKeyDown() {

View File

@@ -305,12 +305,11 @@ function onWindowResize(event) {
var attachmentswidth = 0;
if (attachmentsarea.style.display)
attachmentswidth = attachmentsarea.getWidth();
var windowwidth = (typeof self.innerWidth == "number" ? self.innerWidth : document.body.clientWidth);
var subjectfield = $(document).getElementsByClassName('headerField', $('subjectRow'))[0];
var subjectinput = $(document).getElementsByClassName('textField', $('subjectRow'))[0];
// Resize subject field
subjectinput.setStyle({ width: (windowwidth
subjectinput.setStyle({ width: (window.width()
- $(subjectfield).getWidth()
- attachmentswidth
- 4 - 30
@@ -319,7 +318,7 @@ function onWindowResize(event) {
// Resize address fields
var addresslist = $('addressList');
var firstselect = document.getElementsByClassName('headerField', addresslist)[0];
var inputwidth = windowwidth - $(firstselect).getWidth() - attachmentswidth - 24 - 30;
var inputwidth = $(this).width - $(firstselect).getWidth() - attachmentswidth - 24 - 30;
var addresses = document.getElementsByClassName('textField', addresslist);
for (var i = 0; i < addresses.length; i++) {
addresses[i].setStyle({ width: inputwidth + 'px' });