Browse Source

Merge pull request #61 from rafalp/develop

Merged in improvements from dev branch
Rafał Pitoń 12 years ago
parent
commit
5b44ea57e8
2 changed files with 5 additions and 10 deletions
  1. 4 9
      static/cranefly/js/cranefly.js
  2. 1 1
      templates/cranefly/base.html

+ 4 - 9
static/cranefly/js/cranefly.js

@@ -145,14 +145,6 @@ function link2player(link) {
 	return false;
 }
 
-// Ajax errors handler
-$(document).ajaxError(function(event, jqXHR, settings) {
-	var responseJSON = jQuery.parseJSON(jqXHR.responseText);
-	if (responseJSON.message) {
-		alert(responseJSON.message);
-	}
-});
-
 // Ajax: Post votes
 $(function() {
 	$('.post-rating-actions').each(function() {
@@ -188,7 +180,10 @@ $(function() {
 					$(action_parent).find('.form-upvote button').removeAttr("disabled");
 					$(action_parent).find('.form-downvote button').attr("disabled", "disabled");
 				}
-			}).error();
+			}).fail(function() {
+				$(form).unbind();
+				$(form).trigger('submit');
+			});
 			return false;
 		});
 	});

+ 1 - 1
templates/cranefly/base.html

@@ -6,7 +6,7 @@
     <title>{% block title %}{{ page_title() }}{% endblock %}</title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">{% block meta %}{% endblock %}
     <link href="{{ STATIC_URL }}cranefly/css/cranefly.css" rel="stylesheet">{% block stylesheets %}{% endblock %}
-    <link rel="shortcut icon" href="{{ STATIC_URL }}favicon.ico" />
+    <link rel="shortcut icon" href="{{ STATIC_URL }}favicon.ico">
   </head>
   <body itemscope itemtype="http://schema.org/WebPage"{% block body_class %}{% endblock %}>
   	{% block body %}{% endblock %}