Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SOC-5 #comment JS code was in wrong place and form had the wrong clas…
…s name.
- Loading branch information
1 parent
8a4feab
commit 4d7101b
Showing
3 changed files
with
26 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
# comments.js.coffee | ||
jQuery -> | ||
# Create a comment | ||
$(".comment-form") | ||
.on "ajax:beforeSend", (evt, xhr, settings) -> | ||
$(this).find('textarea') | ||
.addClass('uneditable-input') | ||
.attr('disabled', 'disabled'); | ||
.on "ajax:success", (evt, data, status, xhr) -> | ||
$(this).find('textarea') | ||
.removeClass('uneditable-input') | ||
.removeAttr('disabled', 'disabled') | ||
.val(''); | ||
$(xhr.responseText).hide().insertAfter($(this)).show('slow') | ||
# Delete a comment | ||
$(document) | ||
.on "ajax:beforeSend", ".comment", -> | ||
$(this).fadeTo('fast', 0.5) | ||
.on "ajax:success", ".comment", -> | ||
$(this).hide('fast') | ||
.on "ajax:error", ".comment", -> | ||
$(this).fadeTo('fast', 1) | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||
jQuery -> | ||
# Create a comment | ||
$(".comment-form") | ||
.on "ajax:beforeSend", (evt, xhr, settings) -> | ||
$(this).find('textarea') | ||
.addClass('uneditable-input') | ||
.attr('disabled', 'disabled'); | ||
.on "ajax:success", (evt, data, status, xhr) -> | ||
$(this).find('textarea') | ||
.removeClass('uneditable-input') | ||
.removeAttr('disabled', 'disabled') | ||
.val(''); | ||
$(xhr.responseText).hide().insertAfter($(this)).show('slow') | ||
# Delete a comment | ||
$(document) | ||
.on "ajax:beforeSend", ".comment", -> | ||
$(this).fadeTo('fast', 0.5) | ||
.on "ajax:success", ".comment", -> | ||
$(this).hide('fast') | ||
.on "ajax:error", ".comment", -> | ||
$(this).fadeTo('fast', 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters