mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-10 04:19:38 +02:00
workaround for bug #91
This commit is contained in:
parent
783696ad8e
commit
ebc11ba91a
@ -4,7 +4,8 @@ import ModFoundOverview from './ModFoundOverview.jsx';
|
||||
class ModSearch extends React.Component {
|
||||
render() {
|
||||
if(this.props.loggedIn) {
|
||||
return (
|
||||
//TODO switch back to currently commented out code, when the mod-portal-api is back with all features!!
|
||||
/*return (
|
||||
<div className="box-body">
|
||||
<form onSubmit={this.props.submitSearchMod}>
|
||||
<div className="input-group col-lg-5">
|
||||
@ -19,6 +20,18 @@ class ModSearch extends React.Component {
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
)*/
|
||||
return (
|
||||
<div className="box-body">
|
||||
<form onSubmit={this.props.loadDownloadList}>
|
||||
<div className="input-group col-lg-5">
|
||||
<input type="text" className="form-control" placeholder="Download mod by ID" name="modId" />
|
||||
<span className="input-group-btn">
|
||||
<input className="btn btn-default" type="submit" value="Go!"/>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
@ -44,7 +57,8 @@ class ModSearch extends React.Component {
|
||||
ModSearch.propTypes = {
|
||||
submitSearchMod: React.PropTypes.func.isRequired,
|
||||
loggedIn: React.PropTypes.bool.isRequired,
|
||||
submitFactorioLogin: React.PropTypes.func.isRequired
|
||||
submitFactorioLogin: React.PropTypes.func.isRequired,
|
||||
loadDownloadList: React.PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
export default ModSearch;
|
@ -156,12 +156,15 @@ class ModsContent extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
//TODO remove modIdInput, when the factorio-mod-portal-api is fixed
|
||||
// all outcommented needs to be reimplemented, when it will work again
|
||||
loadDownloadList(e) {
|
||||
e.preventDefault();
|
||||
let $button = $(e.target);
|
||||
let $loader = $("<div class='loader'></div>");
|
||||
$button.prepend($loader);
|
||||
let modId = $button.data("modId");
|
||||
// let $button = $(e.target);
|
||||
// let $loader = $("<div class='loader'></div>");
|
||||
// $button.prepend($loader);
|
||||
let modId = $(e.target).find("input[name=modId]").val();
|
||||
// let modId = $button.data("modId");
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
@ -171,7 +174,7 @@ class ModsContent extends React.Component {
|
||||
},
|
||||
dataType: "json",
|
||||
success: (data) => {
|
||||
$loader.remove();
|
||||
// $loader.remove();
|
||||
|
||||
let correctData = JSON.parse(data.data);
|
||||
|
||||
@ -244,7 +247,7 @@ class ModsContent extends React.Component {
|
||||
},
|
||||
error: (xhr, status, err) => {
|
||||
console.log('api/mods/details', status, err.toString());
|
||||
$loader.remove();
|
||||
// $loader.remove();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user