diff options
author | Roald de Vries <rdevries@thoughtworks.com> | 2016-12-07 15:26:10 +0100 |
---|---|---|
committer | Roald de Vries <rdevries@thoughtworks.com> | 2016-12-07 15:26:10 +0100 |
commit | d10f607a4d40587510b0dc31b31fe4750bf4a3a3 (patch) | |
tree | db016bb0878989249e0f329e2162d11067b0f8b7 /web-ui/public/js/mail_list_actions/ui/archive_many_trigger.js | |
parent | c28abba2f5b1186c671ebef508d40ffaae6d5bc5 (diff) | |
parent | eaf2019b6e977d1191e0ee12f694a02bb9612f83 (diff) |
[#801] Merge branch 'signup'
Diffstat (limited to 'web-ui/public/js/mail_list_actions/ui/archive_many_trigger.js')
-rw-r--r-- | web-ui/public/js/mail_list_actions/ui/archive_many_trigger.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/web-ui/public/js/mail_list_actions/ui/archive_many_trigger.js b/web-ui/public/js/mail_list_actions/ui/archive_many_trigger.js new file mode 100644 index 00000000..b148cdce --- /dev/null +++ b/web-ui/public/js/mail_list_actions/ui/archive_many_trigger.js @@ -0,0 +1,29 @@ +define( + [ + 'flight/lib/component', + 'views/templates', + 'mixins/with_enable_disable_on_event', + 'page/events' + ], + + function(definecomponent, templates, withEnableDisableOnEvent, events) { + 'use strict'; + + return definecomponent(archiveManyTrigger, withEnableDisableOnEvent(events.ui.mails.hasMailsChecked)); + function archiveManyTrigger() { + + this.getMailsToArchive = function() { + this.trigger(document, events.ui.mail.wantChecked, this.$node); + }; + + this.archiveManyEmails = function(event, data) { + this.trigger(document, events.mail.archiveMany, data); + }; + + this.after('initialize', function () { + this.on('click', this.getMailsToArchive); + this.on(events.ui.mail.hereChecked, this.archiveManyEmails); + }); + } + } +); |