diff options
author | Renata Carreira <re.carreira@gmail.com> | 2015-04-08 19:28:02 -0300 |
---|---|---|
committer | Renata Carreira <re.carreira@gmail.com> | 2015-04-08 19:28:02 -0300 |
commit | bf97c68ba4ec2f61a0d630a1dbe3a717bce7ff26 (patch) | |
tree | 1ff1575c18da1689aa2e6d79fc61582d0a4c4ff1 | |
parent | 2c7cf0b90feff4146fcb81ee6a1629a10f1921ad (diff) |
Unchecking all emails when changing inbox
Triggering events.ui.mails.uncheckAll when calling
events.ui.tag.select
refers to #289
with @mindyor :)
-rw-r--r-- | web-ui/app/js/tags/ui/tag_list.js | 1 | ||||
-rw-r--r-- | web-ui/test/spec/tags/ui/tag_list.spec.js | 7 |
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}); |