1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 09:41:26 +02:00

Improve appearance/behaviour of login/signup/forgot modals

This commit is contained in:
Toby Zerner
2015-05-26 16:25:25 +09:30
parent 17e57c9baa
commit 95e5a2d69d
10 changed files with 209 additions and 143 deletions

View File

@@ -18,11 +18,12 @@ class App {
}
request(options) {
options.extract = options.extract || function(xhr, xhrOptions) {
var extract = options.extract;
options.extract = function(xhr, xhrOptions) {
if (xhr.status === 500) {
throw new ServerError;
}
return xhr.responseText;
return extract ? extract(xhr.responseText) : (xhr.responseText.length === 0 ? null : xhr.responseText);
};
return m.request(options).then(response => {