summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorRafael Lisboa <rafaelzlisboa@gmail.com>2015-04-08 20:09:24 -0300
committerRafael Lisboa <rafaelzlisboa@gmail.com>2015-04-08 20:09:24 -0300
commit009a945b9472c8a3aed9980f27396f1da33672ac (patch)
treec4025393629609d59fe3b4c3bdd7241f4970886c /web-ui
parent497488499fcf870df762919e42862ca6b52a0028 (diff)
parentbf97c68ba4ec2f61a0d630a1dbe3a717bce7ff26 (diff)
Merge pull request #366 from recarreira/master
Unchecking all emails when changing inbox
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/tags/ui/tag_list.js1
-rw-r--r--web-ui/test/spec/tags/ui/tag_list.spec.js7
2 files changed, 8 insertions, 0 deletions
diff --git a/web-ui/app/js/tags/ui/tag_list.js b/web-ui/app/js/tags/ui/tag_list.js
index a2172c6d..d6f6f76c 100644
--- a/web-ui/app/js/tags/ui/tag_list.js
+++ b/web-ui/app/js/tags/ui/tag_list.js
@@ -98,6 +98,7 @@ define(
this.after('initialize', function() {
this.on(document, events.tags.received, this.displayTags);
this.on(document, events.ui.tag.select, this.updateCurrentTag);
+ this.on(document, events.ui.tag.select, events.ui.mails.uncheckAll);
this.renderTagListTemplate();
});
}
diff --git a/web-ui/test/spec/tags/ui/tag_list.spec.js b/web-ui/test/spec/tags/ui/tag_list.spec.js
index f92f72af..e84c68aa 100644
--- a/web-ui/test/spec/tags/ui/tag_list.spec.js
+++ b/web-ui/test/spec/tags/ui/tag_list.spec.js
@@ -62,6 +62,13 @@ describeComponent('tags/ui/tag_list', function () {
expect(this.component.attr.currentTag).toEqual('amazing');
});
+ it('should uncheck all emails when a new tag is selected', function () {
+ var uncheckAllEvent = spyOnEvent(document, Pixelated.events.ui.mails.uncheckAll);
+ $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'amazing'});
+
+ expect(uncheckAllEvent).toHaveBeenTriggeredOn(document);
+ });
+
it('resets the tag lists when loading tags', function () {
var tagList = [tag('tag1', 1, false), tag('tag2', 2, true), tag('tag3', 3, true)];
$(document).trigger(Pixelated.events.tags.received, {tags: tagList});