From ebc11ba91a244c51665b0d25b221d5856a09811f Mon Sep 17 00:00:00 2001 From: knoxfighter Date: Sun, 11 Feb 2018 21:47:32 +0100 Subject: [PATCH] workaround for bug #91 --- ui/App/components/Mods/search/ModSearch.jsx | 18 ++++++++++++++++-- ui/App/components/ModsContent.jsx | 15 +++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ui/App/components/Mods/search/ModSearch.jsx b/ui/App/components/Mods/search/ModSearch.jsx index 0b53c0d..1052320 100644 --- a/ui/App/components/Mods/search/ModSearch.jsx +++ b/ui/App/components/Mods/search/ModSearch.jsx @@ -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 (
@@ -19,6 +20,18 @@ class ModSearch extends React.Component { {...this.props} />
+ )*/ + return ( +
+ +
+ + + + +
+ +
) } 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; \ No newline at end of file diff --git a/ui/App/components/ModsContent.jsx b/ui/App/components/ModsContent.jsx index d780935..94668b0 100644 --- a/ui/App/components/ModsContent.jsx +++ b/ui/App/components/ModsContent.jsx @@ -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 = $("
"); - $button.prepend($loader); - let modId = $button.data("modId"); + // let $button = $(e.target); + // let $loader = $("
"); + // $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(); } }) }