diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-12 07:20:26 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-12 07:20:26 +0100 |
| commit | 3af81b5dd49717e9dc646336df322d9432573ab7 (patch) | |
| tree | 6598b28703056f2f2c1352be1c88804545a7f9e8 /public/assets/js/lib/views/mail/compose.js | |
| parent | b29bf8bdc1d43699160d542a636fb1e65362b7ae (diff) | |
styling compose box
Diffstat (limited to 'public/assets/js/lib/views/mail/compose.js')
| -rw-r--r-- | public/assets/js/lib/views/mail/compose.js | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/public/assets/js/lib/views/mail/compose.js b/public/assets/js/lib/views/mail/compose.js index 49f29f4..2c76b3f 100644 --- a/public/assets/js/lib/views/mail/compose.js +++ b/public/assets/js/lib/views/mail/compose.js @@ -1,3 +1,36 @@ var ComposeView = FormView.extend({ + + el: "#compose", + + events: { + }, + + action: "", + + initialize: function(){ + this.__super__.initialize.call(this) + this.template = this.$(".template").html() + }, + + load: function(username){ + this.$("[name=username]").val(sanitize(username)) + $("body").removeClass('loading') + }, + + validate: function(){ + var errors = [] + var username = $("[name=username]").val() + var message = $("[name=message]").val() + if (! username || ! username.length) { + errors.push("Please enter who this message is going to.") + } + if (! message || ! message.length) { + errors.push("Please enter your message.") + } + return errors.length ? errors : null + }, -}) + success: function(){ + window.location.reload() + } +})
\ No newline at end of file |
