Merge pull request #166 from orangemug/feature/load-from-url

Added 'Load from URL' option in open modal
This commit is contained in:
Orange Mug 2017-10-12 19:14:31 +01:00 committed by GitHub
commit e1f7336aa9

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>