diff --git a/app/models/photo.rb b/app/models/photo.rb index bbab52403125c50a49c514570d9573db92689067..b125bcf62a814c1530f0655304bb651d46aeb328 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -101,7 +101,7 @@ class Photo < Post end def process - return false if unprocessed_image.path.include?('.gif') || self.processed? + return false if self.processed? || unprocessed_image.path.include?('.gif') processed_image.store!(unprocessed_image) #Ultra naive save! end diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index b322e9f80ecf99c774dbd40c653cd25b739488e4..e28cabde25963abf54fc34115cff137654368315 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -272,9 +272,10 @@ var Publisher = { determineSubmitAvailability: function(){ var onlyWhitespaces = (Publisher.input().val().trim() == ''); var isSubmitDisabled = Publisher.submit().attr('disabled'); - if (onlyWhitespaces && !isSubmitDisabled) { + var isPhotoAttached = ($("#photodropzone").children().length > 0) + if ((onlyWhitespaces && !isPhotoAttached) && !isSubmitDisabled) { Publisher.submit().attr('disabled', true); - } else if (!onlyWhitespaces && isSubmitDisabled) { + } else if ((!onlyWhitespaces || isPhotoAttached) && isSubmitDisabled) { Publisher.submit().removeAttr('disabled'); } },