diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-06-10 12:00:24 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-06-10 12:00:24 -0400 |
| commit | 9fb0fe9b7ef614d2248b00ea2b964205f3453f41 (patch) | |
| tree | 953fd956e1c6b3d641226d7ac36cc749ced92504 /public/assets/javascripts/ui/EditProjectModal.js | |
| parent | 3f8e4223cc57bc3fd461881e3d6e9eb331bf4dc5 (diff) | |
split up builder functionality
Diffstat (limited to 'public/assets/javascripts/ui/EditProjectModal.js')
| -rw-r--r-- | public/assets/javascripts/ui/EditProjectModal.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/public/assets/javascripts/ui/EditProjectModal.js b/public/assets/javascripts/ui/EditProjectModal.js deleted file mode 100644 index 356d8b7..0000000 --- a/public/assets/javascripts/ui/EditProjectModal.js +++ /dev/null @@ -1,49 +0,0 @@ - -var EditProjectModal = ModalView.extend({ - el: ".mediaDrawer.editProject", - action: "/project/edit", - - events: { - "submit form": "submit" - }, - - initialize: function(){ - this.$form = this.$("form") - this.$errors = this.$(".errors") - this.$errorList = this.$(".errorList") - }, - - reset: function(){ - this.$("input").not("[type='submit']").not("[type='hidden']").val("") - }, - - load: function(){ - this.reset() - this.show() - }, - - submit: function(e){ - e.preventDefault() - - this.$errors.hide(); - this.$errorList.empty() - - var fields = this.$form.serializeArray() - - var request = $.post(this.action, $.param(fields)); - request.done($.proxy(function (response) { - if (response.error) { - this.$errors.show(); - for (var key in response.error.errors) { - this.$errorList.append('<div>' + response.error.errors[key].message + '</div>'); - } - return - } - else { - window.location.href = "/profile" - } - }, this)); - } - -}) - |
