Created
March 31, 2015 02:46
-
-
Save desyncr/a30c95b2129f4c6a3ae2 to your computer and use it in GitHub Desktop.
Changes to fix #5524 and #5483
This file contains hidden or 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
| diff --git a/app/assets/javascripts/mobile/mobile.js b/app/assets/javascripts/mobile/mobile.js | |
| index 5cd873f..1bd3710 100644 | |
| --- a/app/assets/javascripts/mobile/mobile.js | |
| +++ b/app/assets/javascripts/mobile/mobile.js | |
| @@ -188,15 +188,17 @@ $(document).ready(function(){ | |
| $(".stream").delegate("a.comment_action", "tap click", function(evt){ | |
| evt.preventDefault(); | |
| - var link = $(this); | |
| + var link = $(this), | |
| + commentForm = link.closest(".bottom_bar").find("form.new_comment"); | |
| - if(link.hasClass('inactive')) { | |
| + if (link.hasClass('inactive') && !commentForm.length) { | |
| var parent = link.closest(".bottom_bar").first(), | |
| container = link.closest('.bottom_bar').find('.add_comment_bottom_link_container').first(); | |
| $.ajax({ | |
| url: link.attr('href'), | |
| beforeSend: function(){ | |
| + link.removeClass('inactive'); | |
| link.addClass('loading'); | |
| }, | |
| context: link, | |
| @@ -212,6 +214,10 @@ $(document).ready(function(){ | |
| parent.append(data); | |
| MBP.autogrow(textarea($(this))); | |
| + }, | |
| + error: function() { | |
| + // make the pencil icon tap-able again | |
| + link.addClass('inactive'); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment