1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-26 11:16:28 +02:00

Remove stopPropagation for event in FileDragAndDrop

This commit is contained in:
Tim Daubenschütz 2015-10-13 16:12:05 +02:00
parent bb93a052b7
commit 984761a386
2 changed files with 10 additions and 9 deletions

View File

@ -121,13 +121,12 @@ let FileDragAndDrop = React.createClass({
// Firefox only recognizes the simulated mouse click if bubbles is set to true,
// but since Google Chrome propagates the event much further than needed, we
// need to stop propagation as soon as the event is created
var evt = new MouseEvent('click', {
let evt = new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true
});
evt.stopPropagation();
this.refs.fileinput.getDOMNode().dispatchEvent(evt);
},

View File

@ -57,12 +57,14 @@ class Requests {
});
}
handleError(err) {
if (err instanceof TypeError) {
throw new Error('Server did not respond to the request. (Not even displayed a 500)');
} else {
throw err;
}
handleError(url) {
return (err) => {
if (err instanceof TypeError) {
throw new Error('For: ' + url + ' - Server did not respond to the request. (Not even displayed a 500)');
} else {
throw err;
}
};
}
getUrl(url) {
@ -118,7 +120,7 @@ class Requests {
merged.method = verb;
return fetch(url, merged)
.then(this.unpackResponse)
.catch(this.handleError);
.catch(this.handleError(url));
}
get(url, params) {