Various fixes and improvements to the Mail module

This commit is contained in:
Francis Lachapelle
2014-09-10 11:37:52 -04:00
parent c441fa5b80
commit 1dd3dbacb5
8 changed files with 60 additions and 38 deletions
+18 -11
View File
@@ -35,7 +35,7 @@ var refreshViewCheckTimer;
// Variables for feature threadsCollapsing
var displayThreadElement = false;
var cachedThreadsCollapsed = (UserSettings.Mail ? UserSettings.Mail.threadsCollapsed: []);
var cachedThreadsCollapsed = [];
/* We need to override this method since it is adapted to GCS-based folder
references, which we do not use here */
@@ -457,6 +457,7 @@ function onDocumentKeydown(event) {
/* Search mail, call the template and open inside a dialog windoƒw */
function onSearchMail(event) {
Event.stop(event);
var element = Event.findElement(event);
if (element.disabled == false || element.disabled == undefined) {
element.disabled = true;
@@ -473,12 +474,13 @@ function onSearchMail(event) {
triggerAjaxRequest(urlstr, displaySearchMailCallback);
}
}
return false;
}
function displaySearchMailCallback(http) {
if (http.readyState == 4 && http.status == 200) {
var fields = createElement("div", null); // (tagName, id, classes, attributes, htmlAttributes, parentNode)
var title = _("Search mail");
var title = _("Search multiple mailboxes");
var id = _("searchMailView");
fields.innerHTML = http.responseText;
@@ -2033,15 +2035,20 @@ function initMailer(event) {
else if (!Mailer.sortByThread && Mailer.columnsOrder[0] == "Thread")
Mailer.columnsOrder.shift(); // drop the thread column
// Restore sorting from user settings
if (UserSettings && UserSettings["Mail"] && UserSettings["Mail"]["SortingState"]) {
sorting["attribute"] = UserSettings["Mail"]["SortingState"][0];
sorting["ascending"] = parseInt(UserSettings["Mail"]["SortingState"][1]) > 0;
if (sorting["attribute"] == 'to') sorting["attribute"] = 'from'; // initial mailbox is always the inbox
}
else {
sorting["attribute"] = "date";
sorting["ascending"] = false;
if (UserSettings && UserSettings.Mail) {
// Restore threads
cachedThreadsCollapsed = UserSettings.Mail.threadsCollapsed;
// Restore sorting from user settings
if (UserSettings.Mail.SortingState) {
sorting["attribute"] = UserSettings["Mail"]["SortingState"][0];
sorting["ascending"] = parseInt(UserSettings["Mail"]["SortingState"][1]) > 0;
if (sorting["attribute"] == 'to') sorting["attribute"] = 'from'; // initial mailbox is always the inbox
}
else {
sorting["attribute"] = "date";
sorting["ascending"] = false;
}
}
Mailer.dataTable = $("mailboxList");
+20 -5
View File
@@ -1,3 +1,17 @@
/*************** Dialog *****************/
DIV.dialog.searchMail {
position: relative;
padding: 0px;
opacity: 1;
width: 85%;
height: 75%;
margin: 2em auto;
}
DIV.dialog.searchMail > DIV {
min-height: 500px;
}
/*************** Table adjustment *****************/
@@ -44,7 +58,7 @@ TR.filterRow > TD
TR.filterRow > TD.buttonsCell
{
width:5%;
width: 40px;
}
TR.filterRow > TD.inputsCell
@@ -172,15 +186,16 @@ A#deleteButton, A#openButton
top: -18px;
left: -18px; }
#filterButtons
.filterButtons
{
width:40px;
width: 40px;
}
IMG.addFilterButton, IMG.removeFilterButton
.filterButtons IMG
{
z-index: 1;
cursor:pointer;
cursor: pointer;
vertical-align: middle;
}
/* Glow */
+1 -3
View File
@@ -305,9 +305,7 @@ function onAddFilter() {
var imageRemoveFilter = document.createElement("img");
imageAddFilter.setAttribute("src", "/SOGo.woa/WebServerResources/add-icon.png");
imageRemoveFilter.setAttribute("src", "/SOGo.woa/WebServerResources/remove-icon.png");
Element.addClassName(imageAddFilter, "addFilterButton");
Element.addClassName(imageAddFilter, "glow");
Element.addClassName(imageRemoveFilter, "removeFilterButton");
Element.addClassName(imageRemoveFilter, "glow");
imageAddFilter.setAttribute("name", "addFilter");
imageAddFilter.setAttribute("id", "addFilterButtonRow" + rowCount);
@@ -315,7 +313,7 @@ function onAddFilter() {
imageRemoveFilter.setAttribute("name", "removeFilter");
imageRemoveFilter.setAttribute("id", "removeFilterButtonRow" + rowCount);
$(imageRemoveFilter).on("click", onRemoveFilter);
buttonsDiv.setAttribute("id", "filterButtons");
Element.addClassName(buttonsDiv, "filterButtons");
buttonsDiv.appendChild(imageAddFilter);
buttonsDiv.appendChild(imageRemoveFilter);
-13
View File
@@ -659,19 +659,6 @@ DIV.dialog > DIV
top: 7px;
}
DIV.dialog.searchMail {
position: relative;
padding: 0px;
opacity: 1;
width: 75%;
height: 75%;
margin: 2em auto;
}
DIV.dialog.searchMail > DIV {
min-height:500px;
}
DIV.dialog.none
{ position: relative;
margin: 0px;