Skip to content

Commit

Permalink
Does not submit post on enter if there are pending attachments. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
epicmonkey committed Jun 10, 2015
1 parent 5447690 commit c75b979
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public/js/app/fields/CreatePostView.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
define(["app/app"], function(App) {
define(["app/app", "ember"], function(App, Ember) {
"use strict";

App.CreatePostView = Ember.TextArea.extend(Ember.TargetActionSupport, {
classNames: ['edit-post-area'],
valueBinding: 'parentView.controller.body',
action: 'create',
action: function() {
if (!(this.get('parentView.controller.isUploadingAttachment')
|| Ember.isBlank(this.get('value'))))
return 'create'
}.property('parentView.controller.isUploadingAttachment'),
viewName: 'createPost',

keyPress: function (e) {
Expand Down

0 comments on commit c75b979

Please sign in to comment.