fix a bunch of cukes. the disabled functionilty in rails helpers changed and we had to update out JS accordingly
This commit is contained in:
parent
03409495f9
commit
0883ce1dbb
2 changed files with 7 additions and 4 deletions
|
|
@ -44,8 +44,9 @@ class AspectMembershipsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@person = Person.find(params[:person_id])
|
@person = Person.find(params[:person_id])
|
||||||
@aspect = current_user.aspects.where(:id => params[:aspect_id]).first
|
@aspect = current_user.aspects.where(:id => params[:aspect_id]).first
|
||||||
|
@contact = current_user.share_with(@person, @aspect)
|
||||||
|
|
||||||
if @contact = current_user.share_with(@person, @aspect)
|
if @contact
|
||||||
flash.now[:notice] = I18n.t('aspects.add_to_aspect.success')
|
flash.now[:notice] = I18n.t('aspects.add_to_aspect.success')
|
||||||
respond_with AspectMembership.where(:contact_id => @contact.id, :aspect_id => @aspect.id).first
|
respond_with AspectMembership.where(:contact_id => @contact.id, :aspect_id => @aspect.id).first
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ var Publisher = {
|
||||||
},
|
},
|
||||||
|
|
||||||
submit: function(){
|
submit: function(){
|
||||||
return Publisher.cachedSubmit = Publisher.cachedSubmit || Publisher.form().find('#status_message_submit');
|
return Publisher.cachedSubmit = Publisher.cachedSubmit || Publisher.form().find("input[type='submit']");
|
||||||
},
|
},
|
||||||
|
|
||||||
determineSubmitAvailability: function(){
|
determineSubmitAvailability: function(){
|
||||||
|
|
@ -32,8 +32,8 @@ var Publisher = {
|
||||||
isSubmitDisabled = Publisher.submit().attr('disabled'),
|
isSubmitDisabled = Publisher.submit().attr('disabled'),
|
||||||
isPhotoAttached = ($("#photodropzone").children().length > 0);
|
isPhotoAttached = ($("#photodropzone").children().length > 0);
|
||||||
|
|
||||||
if ((onlyWhitespaces && !isPhotoAttached) && !isSubmitDisabled) {
|
if ((onlyWhitespaces && !isPhotoAttached) && !isSubmitDisabled) {
|
||||||
Publisher.submit().attr('disabled', true);
|
Publisher.submit().attr('disabled', 'disabled');
|
||||||
} else if ((!onlyWhitespaces || isPhotoAttached) && isSubmitDisabled) {
|
} else if ((!onlyWhitespaces || isPhotoAttached) && isSubmitDisabled) {
|
||||||
Publisher.submit().removeAttr('disabled');
|
Publisher.submit().removeAttr('disabled');
|
||||||
}
|
}
|
||||||
|
|
@ -43,6 +43,8 @@ var Publisher = {
|
||||||
$("#photodropzone").find('li').remove();
|
$("#photodropzone").find('li').remove();
|
||||||
Publisher.input().mentionsInput("reset");
|
Publisher.input().mentionsInput("reset");
|
||||||
Publisher.wrapper().removeClass("with_attachments");
|
Publisher.wrapper().removeClass("with_attachments");
|
||||||
|
Publisher.hiddenInput().val('');
|
||||||
|
Publisher.determineSubmitAvailability()
|
||||||
},
|
},
|
||||||
|
|
||||||
bindServiceIcons: function(){
|
bindServiceIcons: function(){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue