diff options
Diffstat (limited to 'web-ui/app/js')
-rw-r--r-- | web-ui/app/js/foundation/off_canvas.js | 20 | ||||
-rw-r--r-- | web-ui/app/js/mail_list/ui/mail_list.js | 2 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/mail_view.js | 2 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/recipients/recipients_input.js | 2 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/send_button.js | 47 | ||||
-rw-r--r-- | web-ui/app/js/mixins/with_mail_edit_base.js | 1 | ||||
-rw-r--r-- | web-ui/app/js/page/events.js | 4 |
7 files changed, 50 insertions, 28 deletions
diff --git a/web-ui/app/js/foundation/off_canvas.js b/web-ui/app/js/foundation/off_canvas.js index 8dfd75ba..805dfab8 100644 --- a/web-ui/app/js/foundation/off_canvas.js +++ b/web-ui/app/js/foundation/off_canvas.js @@ -19,13 +19,29 @@ define(['flight/lib/component', 'page/events'], function (defineComponent, event return defineComponent(function() { - this.closeSlider = function (){ - $('.exit-off-canvas').click(); + this.closeSlider = function (ev){ + $('.off-canvas-wrap.content').removeClass('move-right'); + this.toggleTagsVisibility(); + }; + + this.toggleSlideContent = function (ev) { + ev.preventDefault(); + $('.left-off-canvas-toggle').click(); + this.toggleTagsVisibility(); + }; + + this.toggleTagsVisibility = function () { + if ($('.off-canvas-wrap.content').hasClass('move-right')) { + $('#custom-tag-list').addClass('expanded'); + } else { + $('#custom-tag-list').removeClass('expanded'); + } }; this.after('initialize', function () { this.on($('#middle-pane-container'), 'click', this.closeSlider); this.on($('#right-pane'), 'click', this.closeSlider); + this.on($('.side-nav-toggle'), 'click', this.toggleSlideContent); }); }); }); diff --git a/web-ui/app/js/mail_list/ui/mail_list.js b/web-ui/app/js/mail_list/ui/mail_list.js index 69327a57..18d36049 100644 --- a/web-ui/app/js/mail_list/ui/mail_list.js +++ b/web-ui/app/js/mail_list/ui/mail_list.js @@ -93,7 +93,6 @@ define( this.showMails = function (event, data) { this.updateCurrentTagAndMail(data); this.refreshMailList(null, data); - this.triggerScrollReset(); this.triggerMailOpenForPopState(data); this.openMailFromUrl(); }; @@ -114,6 +113,7 @@ define( this.cleanSelected = function () { this.attr.currentMailIdent = ''; + this.triggerScrollReset(); }; this.respondWithCheckedMails = function (ev, caller) { diff --git a/web-ui/app/js/mail_view/ui/mail_view.js b/web-ui/app/js/mail_view/ui/mail_view.js index 4faba468..578dcbb9 100644 --- a/web-ui/app/js/mail_view/ui/mail_view.js +++ b/web-ui/app/js/mail_view/ui/mail_view.js @@ -108,7 +108,7 @@ define( var status = ['encrypted']; if(_.any(mail.security_casing.locks, function (lock) { return lock.state === 'valid'; })) { status.push('encryption-valid'); } - else { status.push('encryption-failure'); } + else { status.push('encryption-error'); } return status.join(' '); }; diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js index 459c8b24..012d7fb9 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js @@ -136,7 +136,7 @@ define([ }; this.warnSendButtonOfInputState = function () { - var toTrigger = _.isEmpty(this.$node.val()) ? events.ui.recipients.inputHasNoMail : events.ui.recipients.inputHasMail; + var toTrigger = _.isEmpty(this.$node.val()) ? events.ui.recipients.inputFieldIsEmpty : events.ui.recipients.inputFieldHasCharacters; this.trigger(document, toTrigger, { name: this.attr.name }); }; diff --git a/web-ui/app/js/mail_view/ui/send_button.js b/web-ui/app/js/mail_view/ui/send_button.js index 8f168ecc..5c1c3506 100644 --- a/web-ui/app/js/mail_view/ui/send_button.js +++ b/web-ui/app/js/mail_view/ui/send_button.js @@ -37,35 +37,37 @@ define([ this.$node.prop('disabled', true); }; - this.atLeastOneFieldHasRecipients = function () { + this.atLeastOneInputFieldHasRecipients = function () { return _.any(_.values(this.attr.recipients), function (e) { return !_.isEmpty(e); }); }; - this.atLeastOneInputHasMail = function () { - return _.any(_.values(this.attr.inputHasMail), function (e) { return e === true; }); + this.atLeastOneInputFieldHasCharacters = function () { + return _.any(_.values(this.attr.inputFieldHasCharacters), function (e) { return e === true; }); }; this.updateButton = function () { - if (this.atLeastOneInputHasMail() || this.atLeastOneFieldHasRecipients()) { - this.enableButton(); - } else { - this.disableButton(); + if (this.attr.sendingInProgress === false) { + if (this.atLeastOneInputFieldHasCharacters() || this.atLeastOneInputFieldHasRecipients()) { + this.enableButton(); + } else { + this.disableButton(); + } } }; - this.inputHasNoMail = function (ev, data) { - this.attr.inputHasMail[data.name] = false; + this.inputFieldIsEmpty = function (ev, data) { + this.attr.inputFieldHasCharacters[data.name] = false; this.updateButton(); }; - this.inputHasMail = function (ev, data) { - this.attr.inputHasMail[data.name] = true; + this.inputFieldHasCharacters = function (ev, data) { + this.attr.inputFieldHasCharacters[data.name] = true; this.updateButton(); }; this.updateRecipientsForField = function (ev, data) { this.attr.recipients[data.recipientsName] = data.newRecipients; - this.attr.inputHasMail[data.recipientsName] = false; + this.attr.inputFieldHasCharacters[data.recipientsName] = false; this.updateButton(); }; @@ -77,31 +79,34 @@ define([ this.off(document, events.ui.mail.recipientsUpdated); }.bind(this))); - this.trigger(document, events.ui.recipients.doCompleteInput); this.disableButton(); this.$node.text(viewHelper.i18n('sending-mail')); + this.attr.sendingInProgress = true; + + this.trigger(document, events.ui.recipients.doCompleteInput); }; - this.forceEnableButton = function () { - this.enableButton(); + this.resetButton = function () { + this.attr.sendingInProgress = false; this.$node.html(viewHelper.i18n('send-button')); + this.enableButton(); }; this.after('initialize', function () { this.attr.recipients = {}; - this.attr.inputHasMail = {}; - this.$node.html(viewHelper.i18n('send-button')); + this.attr.inputFieldHasCharacters = {}; + this.resetButton(); - this.on(document, events.ui.recipients.inputHasMail, this.inputHasMail); - this.on(document, events.ui.recipients.inputHasNoMail, this.inputHasNoMail); + this.on(document, events.ui.recipients.inputFieldHasCharacters, this.inputFieldHasCharacters); + this.on(document, events.ui.recipients.inputFieldIsEmpty, this.inputFieldIsEmpty); this.on(document, events.ui.recipients.updated, this.updateRecipientsForField); this.on(this.$node, 'click', this.updateRecipientsAndSendMail); this.on(document, events.dispatchers.rightPane.clear, this.teardown); - this.on(document, events.ui.sendbutton.enable, this.enableButton); - this.on(document, events.mail.send_failed, this.forceEnableButton); + this.on(document, events.ui.sendbutton.enable, this.resetButton); + this.on(document, events.mail.send_failed, this.resetButton); this.disableButton(); }); diff --git a/web-ui/app/js/mixins/with_mail_edit_base.js b/web-ui/app/js/mixins/with_mail_edit_base.js index 3332da91..9942e747 100644 --- a/web-ui/app/js/mixins/with_mail_edit_base.js +++ b/web-ui/app/js/mixins/with_mail_edit_base.js @@ -136,6 +136,7 @@ define( events.ui.userAlerts.displayMessage, {message: i18n.get('One or more of the recipients are not valid emails')} ); + this.trigger(events.mail.send_failed); } }; diff --git a/web-ui/app/js/page/events.js b/web-ui/app/js/page/events.js index ff9ed10a..f7e626f8 100644 --- a/web-ui/app/js/page/events.js +++ b/web-ui/app/js/page/events.js @@ -85,8 +85,8 @@ define(function () { selectLast: 'ui:recipients:selectLast', unselectAll: 'ui:recipients:unselectAll', addressesExist: 'ui:recipients:addressesExist', - inputHasMail: 'ui:recipients:inputHasMail', - inputHasNoMail: 'ui:recipients:inputHasNoMail', + inputFieldHasCharacters: 'ui:recipients:inputFieldHasCharacters', + inputFieldIsEmpty: 'ui:recipients:inputFieldIsEmpty', doCompleteInput: 'ui:recipients:doCompleteInput', doCompleteRecipients: 'ui:recipients:doCompleteRecipients' } |