mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-29 02:07:36 +00:00
Monotone-Parent: bdc770e039bce1273bf76acc5e48dd7006974831
Monotone-Revision: 0c72d1fc3fd84d0415e106b3b511f86237676bdb Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-02-01T18:44:58 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1253,6 +1253,7 @@ function initMailer(event) {
|
||||
// initDnd();
|
||||
initMailboxTree();
|
||||
initMessageCheckTimer();
|
||||
getDragHandlesState();
|
||||
}
|
||||
|
||||
// Default sort options
|
||||
@@ -1486,6 +1487,28 @@ function buildMailboxes(accountName, encoded) {
|
||||
return account;
|
||||
}
|
||||
|
||||
function getDragHandlesState() {
|
||||
var urlstr = ApplicationBaseURL + "dragHandlesState";
|
||||
triggerAjaxRequest(urlstr, getDragHandlesStateCallback);
|
||||
}
|
||||
|
||||
function getDragHandlesStateCallback(http) {
|
||||
if (http.status == 200) {
|
||||
if (http.responseText.length > 0) {
|
||||
// The response text is a JSON array
|
||||
// of the right and top offsets.
|
||||
var data = http.responseText.evalJSON(true);
|
||||
|
||||
$("leftPanel").setStyle({ width: data[0] });
|
||||
$("rightPanel").setStyle({ left: data[0] });
|
||||
$("verticalDragHandle").setStyle({ left: data[0] });
|
||||
$("mailboxContent").setStyle({ height: data[1] });
|
||||
$("messageContent").setStyle({ top: data[1] });
|
||||
$("rightDragHandle").setStyle({ top: data[1] });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getFoldersState() {
|
||||
if (mailAccounts.length > 0) {
|
||||
var urlstr = ApplicationBaseURL + "foldersState";
|
||||
@@ -1496,7 +1519,7 @@ function getFoldersState() {
|
||||
function getFoldersStateCallback(http) {
|
||||
if (http.status == 200) {
|
||||
if (http.responseText.length > 0) {
|
||||
// The response text is a JSOn representation
|
||||
// The response text is a JSON array
|
||||
// of the folders that were left opened.
|
||||
var data = http.responseText.evalJSON(true);
|
||||
for (var i = 1; i < mailboxTree.aNodes.length; i++) {
|
||||
@@ -1509,6 +1532,26 @@ function getFoldersStateCallback(http) {
|
||||
}
|
||||
}
|
||||
|
||||
function saveDragHandlesState() {
|
||||
// Call from SOGoDragHandles.js
|
||||
var leftBlock = $("leftPanel");
|
||||
var upperBlock = $("mailboxContent");
|
||||
|
||||
if (leftBlock && upperBlock) {
|
||||
var dragHandlesState = new Array(leftBlock.getStyle("width"),
|
||||
upperBlock.getStyle("height"));
|
||||
var urlstr = ApplicationBaseURL + "saveDragHandlesState" + "?dragHandles=" + dragHandlesState.toJSON();
|
||||
triggerAjaxRequest(urlstr, saveDragHandlesStateCallback);
|
||||
}
|
||||
}
|
||||
|
||||
function saveDragHandlesStateCallback(http) {
|
||||
if (http.readyState == 4
|
||||
&& isHttpStatus204(http.status)) {
|
||||
log ("drag handles state saved");
|
||||
}
|
||||
}
|
||||
|
||||
function saveFoldersState() {
|
||||
if (mailAccounts.length > 0) {
|
||||
var foldersState = mailboxTree.getFoldersState();
|
||||
|
||||
Reference in New Issue
Block a user