mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Remove stopPropagation for event in FileDragAndDrop
This commit is contained in:
parent
bb93a052b7
commit
984761a386
@ -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);
|
||||
},
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user