Added 'Load from URL' option in open modal. Fixes #120

This commit is contained in:
orangemug 2017-10-10 16:27:16 +01:00
parent c950a33031
commit 2c3f47d3cb

View file

@ -75,6 +75,11 @@ class OpenModal extends React.Component {
})
}
onOpenUrl() {
const url = this.refs.styleUrl.value;
this.onStyleSelect(url);
}
onUpload(_, files) {
const [e, file] = files[0];
const reader = new FileReader();
@ -139,6 +144,18 @@ class OpenModal extends React.Component {
<Button className="maputnik-upload-button"><FileUploadIcon /> Upload</Button>
</FileReaderInput>
</section>
<section className="maputnik-modal-section">
<h2>Load from URL</h2>
<p>
Load from a URL. Note that the URL must have <a href="https://enable-cors.org" target="_blank" rel="noopener noreferrer">CORS enabled</a>.
</p>
<input type="text" ref="styleUrl" className="maputnik-input" placeholder="Enter URL..."/>
<div>
<Button className="maputnik-big-button" onClick={this.onOpenUrl.bind(this)}>Open URL</Button>
</div>
</section>
<section className="maputnik-modal-section maputnik-modal-section--shrink">
<h2>Gallery Styles</h2>
<p>