diff options
-rw-r--r-- | web-ui/app/js/mail_list_actions/ui/mail_list_actions.js | 26 | ||||
-rw-r--r-- | web-ui/app/templates/mail_actions/actions_box.hbs | 2 |
2 files changed, 26 insertions, 2 deletions
diff --git a/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js b/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js index dbabce3d..8987a7d4 100644 --- a/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js +++ b/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js @@ -20,6 +20,8 @@ define( [ 'flight/lib/component', 'views/templates', + 'page/events', + 'page/router/url_params', 'mail_list_actions/ui/compose_trigger', 'mail_list_actions/ui/refresh_trigger', 'mail_list/domain/refresher', @@ -33,6 +35,8 @@ define( function ( defineComponent, templates, + events, + urlParams, composeTrigger, refreshTrigger, refresher, @@ -47,7 +51,9 @@ define( function mailsActions() { this.render = function() { - this.$node.html(templates.mailActions.actionsBox); + this.$node.html(templates.mailActions.actionsBox({ + txtDeleteButton: this.getTxtDeleteButton() + })); refreshTrigger.attachTo('#refresh-trigger'); composeTrigger.attachTo('#compose-trigger'); toggleCheckAllMailTrigger.attachTo('#toggle-check-all-emails'); @@ -58,7 +64,25 @@ define( refresher.attachTo(document); }; + this.getCurrentTag = function () { + return this.attr.currentTag || urlParams.getTag(); + }; + + this.getTxtDeleteButton = function() { + if(this.getCurrentTag() === 'trash') { + return 'Delete permanently'; + } else { + return 'Delete'; + } + }; + + this.updateCurrentTag = function (ev, data) { + this.attr.currentTag = data.tag; + this.render(); + }; + this.after('initialize', function () { + this.on(document, events.ui.tag.select, this.updateCurrentTag); this.render(); }); } diff --git a/web-ui/app/templates/mail_actions/actions_box.hbs b/web-ui/app/templates/mail_actions/actions_box.hbs index b6dc2f53..628a6240 100644 --- a/web-ui/app/templates/mail_actions/actions_box.hbs +++ b/web-ui/app/templates/mail_actions/actions_box.hbs @@ -1,6 +1,6 @@ <li><input type="checkbox" id="toggle-check-all-emails"/></li> <li><input type="button" id="mark-selected-as-read" value="{{t 'Mark as read'}}" disabled="disabled"/></li> <li><input type="button" id="mark-selected-as-unread" value="{{t 'Mark as unread'}}" disabled="disabled"/></li> -<li><input type="button" id="delete-selected" value="{{t 'Delete'}}" disabled="disabled"/></li> +<li><input type="button" id="delete-selected" value="{{t txtDeleteButton}}" disabled="disabled"/></li> <li id="pagination-trigger" class="right"></li> <li id="refresh-trigger" class="right"></li> |