1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-29 00:58:03 +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, // 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 // but since Google Chrome propagates the event much further than needed, we
// need to stop propagation as soon as the event is created // need to stop propagation as soon as the event is created
var evt = new MouseEvent('click', { let evt = new MouseEvent('click', {
view: window, view: window,
bubbles: true, bubbles: true,
cancelable: true cancelable: true
}); });
evt.stopPropagation();
this.refs.fileinput.getDOMNode().dispatchEvent(evt); this.refs.fileinput.getDOMNode().dispatchEvent(evt);
}, },

View File

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