Просмотр исходного кода

Fixed redirect after posting message.

Rafał Pitoń 10 лет назад
Родитель
Сommit
65221ccf84
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      misago/static/misago/js/misago-posting.js

+ 5 - 5
misago/static/misago/js/misago-posting.js

@@ -273,11 +273,11 @@ $(function() {
               if (on_post) {
                 _this.$ajax_complete.addClass('in')
 
-                if (data.post_url.indexOf(window.location.pathname) != -1) {
-                  window.location.href = data.post_url;
-                  window.location.reload(true)
-                } else {
-                  window.location.href = data.post_url;
+                var past_location = window.location.href;
+                window.location.href = data.post_url;
+
+                if (past_location.indexOf(window.location.href)) {
+                  window.reload();
                 }
               }
             } else if (data.errors !== undefined) {