Improve appearance/behaviour of login/signup/forgot modals

This commit is contained in:
Toby Zerner
2015-05-26 16:25:25 +09:30
parent 5fc2f3aeee
commit 85ba97ed5c
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 => {