From 45afed87201ca2d270ab74137310f9d394664768 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 10 Feb 2014 12:43:17 -0500 Subject: [PATCH] FIX: Chrome has a bug where if you request the same URL with a different MIME type, then leave and hit the back button, you'll get the last MIME type requested instead of HTML. This fixes it. --- app/assets/javascripts/admin/models/admin_dashboard.js | 4 ++-- app/assets/javascripts/admin/models/admin_user.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/models/admin_dashboard.js b/app/assets/javascripts/admin/models/admin_dashboard.js index 14b03e8494d..4aaf0984687 100644 --- a/app/assets/javascripts/admin/models/admin_dashboard.js +++ b/app/assets/javascripts/admin/models/admin_dashboard.js @@ -19,7 +19,7 @@ Discourse.AdminDashboard.reopenClass({ @return {jqXHR} a jQuery Promise object **/ find: function() { - return Discourse.ajax("/admin/dashboard").then(function(json) { + return Discourse.ajax("/admin/dashboard.json").then(function(json) { var model = Discourse.AdminDashboard.create(json); model.set('loaded', true); return model; @@ -34,7 +34,7 @@ Discourse.AdminDashboard.reopenClass({ @return {jqXHR} a jQuery Promise object **/ fetchProblems: function() { - return Discourse.ajax("/admin/dashboard/problems", { + return Discourse.ajax("/admin/dashboard/problems.json", { type: 'GET', dataType: 'json' }).then(function(json) { diff --git a/app/assets/javascripts/admin/models/admin_user.js b/app/assets/javascripts/admin/models/admin_user.js index a55873a619e..068eec8aa18 100644 --- a/app/assets/javascripts/admin/models/admin_user.js +++ b/app/assets/javascripts/admin/models/admin_user.js @@ -388,7 +388,7 @@ Discourse.AdminUser.reopenClass({ }, find: function(username) { - return Discourse.ajax("/admin/users/" + username).then(function (result) { + return Discourse.ajax("/admin/users/" + username + ".json").then(function (result) { result.loadedDetails = true; return Discourse.AdminUser.create(result); });