Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 103e87a

Browse files
authored
Merge pull request #259 from modoboa/feature/select_all_button
Added button to select/unselect all messages
2 parents b943122 + d3a15db commit 103e87a

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

modoboa_webmail/static/modoboa_webmail/js/webmail.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ Webmail.prototype = {
162162
});
163163
$document.on('click', '.addcontact', $.proxy(this.addContact, this));
164164
$document.on('click', '.sort-order', $.proxy(this.sortMessages, this));
165+
$document.on('change', '#selectAll', $.proxy(this.toggleSelection, this));
165166
},
166167

167168
/**
@@ -1507,5 +1508,14 @@ Webmail.prototype = {
15071508
}
15081509
this.navobject.setparam('sort_order', newOrder);
15091510
this.navobject.update(true);
1511+
},
1512+
1513+
/**
1514+
* Toggle selection state of all emails.
1515+
*/
1516+
toggleSelection: function(evt) {
1517+
evt.preventDefault();
1518+
const value = evt.target.checked;
1519+
this.htmltable.toggleSelectAll(value);
15101520
}
15111521
};

modoboa_webmail/templates/modoboa_webmail/main_action_bar.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@
33
{% load i18n %}
44

55
{% block before_menubar %}
6-
<div class="col-xs-5">
7-
{% include "common/email_searchbar.html" with extraopts=extraopts %}
8-
</div>
6+
<div class="col-xs-5" style="display: flex">
7+
<input
8+
class="hidden-xs"
9+
type="checkbox" id="selectAll" name="selectAll" style="margin-right: 10px"
10+
title="{% translate "Toggle selection" %}"
11+
/>
12+
<div style="flex: 1">
13+
{% include "common/email_searchbar.html" with extraopts=extraopts %}
14+
</div>
15+
</div>
916
{% endblock %}
1017

1118
{% block menubar_classes %}col-xs-7{% endblock %}

0 commit comments

Comments
 (0)