From c15402e7601ef94516a86420a63ba04e2d6ebb8b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Caruana Date: Thu, 7 Feb 2013 13:00:57 +0100 Subject: [PATCH 1/3] fix ticket #325 : Open message on *simple click* event --- modoboa/extensions/webmail/static/webmail/js/webmail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modoboa/extensions/webmail/static/webmail/js/webmail.js b/modoboa/extensions/webmail/static/webmail/js/webmail.js index 0514d99e4..3dd3cf600 100644 --- a/modoboa/extensions/webmail/static/webmail/js/webmail.js +++ b/modoboa/extensions/webmail/static/webmail/js/webmail.js @@ -91,7 +91,7 @@ Webmail.prototype = { $(document).on("click", "a[name=removembox]", $.proxy(this.remove_mbox, this)); - $(document).on("dblclick", "tbody>tr", + $(document).on("click", "tbody>tr", $.proxy(this.viewmail_loader, this)); $(document).on("click", "a[name=reply]", From cc29b4b4799d87660695332046de85382c76eccb Mon Sep 17 00:00:00 2001 From: Jean-Philippe Caruana Date: Thu, 7 Feb 2013 13:01:39 +0100 Subject: [PATCH 2/3] fix forgotten ; --- modoboa/extensions/webmail/static/webmail/js/webmail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modoboa/extensions/webmail/static/webmail/js/webmail.js b/modoboa/extensions/webmail/static/webmail/js/webmail.js index 3dd3cf600..2d153e0ee 100644 --- a/modoboa/extensions/webmail/static/webmail/js/webmail.js +++ b/modoboa/extensions/webmail/static/webmail/js/webmail.js @@ -81,7 +81,7 @@ Webmail.prototype = { $(document).on("click", "a[name=loadfolder]", $.proxy(this.listmailbox_loader, this)); $(document).on("click", "a[name=selectfolder]", - this.select_parent_mailbox), + this.select_parent_mailbox); $(document).on("click", "div[class*=clickbox]", $.proxy(this.mbox_state_callback, this)); $(document).on("click", "a[name=newmbox]", From f30bc51d4e657707dbed18a80271ef43ff2bd07d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Caruana Date: Thu, 7 Feb 2013 13:02:53 +0100 Subject: [PATCH 3/3] format : binding and functions on one line (more readeable IMHO) --- .../webmail/static/webmail/js/webmail.js | 78 +++++++------------ 1 file changed, 26 insertions(+), 52 deletions(-) diff --git a/modoboa/extensions/webmail/static/webmail/js/webmail.js b/modoboa/extensions/webmail/static/webmail/js/webmail.js index 2d153e0ee..98380a63a 100644 --- a/modoboa/extensions/webmail/static/webmail/js/webmail.js +++ b/modoboa/extensions/webmail/static/webmail/js/webmail.js @@ -47,68 +47,42 @@ Webmail.prototype = { }, register_navcallbacks: function() { - this.navobject.register_callback("listmailbox", - $.proxy(this.listmailbox_callback, this)); - this.navobject.register_callback("compose", - $.proxy(this.compose_callback, this)); - this.navobject.register_callback("viewmail", - $.proxy(this.viewmail_callback, this)); + this.navobject.register_callback("listmailbox", $.proxy(this.listmailbox_callback, this)); + this.navobject.register_callback("compose", $.proxy(this.compose_callback, this)); + this.navobject.register_callback("viewmail", $.proxy(this.viewmail_callback, this)); - this.navobject.register_callback("reply", - $.proxy(this.compose_callback, this)); - this.navobject.register_callback("replyall", - $.proxy(this.compose_callback, this)); - this.navobject.register_callback("forward", - $.proxy(this.compose_callback, this)); - this.navobject.register_callback("delete", - $.proxy(this.delete_callback, this)); + this.navobject.register_callback("reply", $.proxy(this.compose_callback, this)); + this.navobject.register_callback("replyall", $.proxy(this.compose_callback, this)); + this.navobject.register_callback("forward", $.proxy(this.compose_callback, this)); + this.navobject.register_callback("delete", $.proxy(this.delete_callback, this)); }, listen: function() { $(window).resize(this.resize); - $(document).on("click", "a[name=compose]", - $.proxy(this.compose_loader, this)); - $(document).on("click", "a[name*=mark-]", - $.proxy(this.send_mark_request, this)); - $(document).on("click", "a[name=compress]", - $.proxy(this.compress, this)); - $(document).on("click", "a[name=empty]", - $.proxy(this.empty, this)); - $(document).on("click", "#bottom-bar a", - $.proxy(this.getpage_loader, this)); + $(document).on("click", "a[name=compose]", $.proxy(this.compose_loader, this)); + $(document).on("click", "a[name*=mark-]", $.proxy(this.send_mark_request, this)); + $(document).on("click", "a[name=compress]", $.proxy(this.compress, this)); + $(document).on("click", "a[name=empty]", $.proxy(this.empty, this)); + $(document).on("click", "#bottom-bar a", $.proxy(this.getpage_loader, this)); - $(document).on("click", "a[name=loadfolder]", - $.proxy(this.listmailbox_loader, this)); - $(document).on("click", "a[name=selectfolder]", - this.select_parent_mailbox); - $(document).on("click", "div[class*=clickbox]", - $.proxy(this.mbox_state_callback, this)); - $(document).on("click", "a[name=newmbox]", - $.proxy(this.new_mailbox, this)); - $(document).on("click", "a[name=editmbox]", - $.proxy(this.edit_mbox, this)); - $(document).on("click", "a[name=removembox]", - $.proxy(this.remove_mbox, this)); + $(document).on("click", "a[name=loadfolder]", $.proxy(this.listmailbox_loader, this)); + $(document).on("click", "a[name=selectfolder]", this.select_parent_mailbox); + $(document).on("click", "div[class*=clickbox]", $.proxy(this.mbox_state_callback, this)); + $(document).on("click", "a[name=newmbox]", $.proxy(this.new_mailbox, this)); + $(document).on("click", "a[name=editmbox]", $.proxy(this.edit_mbox, this)); + $(document).on("click", "a[name=removembox]", $.proxy(this.remove_mbox, this)); - $(document).on("click", "tbody>tr", - $.proxy(this.viewmail_loader, this)); + $(document).on("click", "tbody>tr", $.proxy(this.viewmail_loader, this)); - $(document).on("click", "a[name=reply]", - $.proxy(this.reply_loader, this)); - $(document).on("click", "a[name=replyall]", - $.proxy(this.reply_loader, this)); - $(document).on("click", "a[name=forward]", - $.proxy(this.reply_loader, this)); - $(document).on("click", "a[name=delete]", - $.proxy(this.delete_message, this)); - $(document).on("click", "a[name=activate_links]", - $.proxy(function(e) { this.display_mode(e, "1"); }, this)); - $(document).on("click", "a[name=disable_links]", - $.proxy(function(e) { this.disable_mode(e, "0"); }, this)); + $(document).on("click", "a[name=reply]", $.proxy(this.reply_loader, this)); + $(document).on("click", "a[name=replyall]", $.proxy(this.reply_loader, this)); + $(document).on("click", "a[name=forward]", $.proxy(this.reply_loader, this)); + $(document).on("click", "a[name=delete]", $.proxy(this.delete_message, this)); + $(document).on("click", "a[name=activate_links]", $.proxy(function(e) { this.display_mode(e, "1"); }, this)); + $(document).on("click", "a[name=disable_links]", $.proxy(function(e) { this.disable_mode(e, "0"); }, this)); - $(document).on("click", "a[name=sendmail]", - $.proxy(this.sendmail, this)); + $(document).on("click", "a[name=sendmail]", $.proxy(this.sendmail, this)); $(document).on("click", "#attachments", $.proxy(function(e) { modalbox(e, undefined, $("#attachments").attr("name"),