mirror of
https://github.com/maputnik/editor.git
synced 2026-08-24 14:07:33 +00:00
Added dialog styling.
This commit is contained in:
@@ -67,7 +67,8 @@ class OpenModal extends React.Component {
|
|||||||
if(this.state.activeRequest) {
|
if(this.state.activeRequest) {
|
||||||
this.state.activeRequest.abort();
|
this.state.activeRequest.abort();
|
||||||
this.setState({
|
this.setState({
|
||||||
activeRequest: null
|
activeRequest: null,
|
||||||
|
activeRequestUrl: null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,12 +76,15 @@ class OpenModal extends React.Component {
|
|||||||
onStyleSelect(styleUrl) {
|
onStyleSelect(styleUrl) {
|
||||||
this.clearError();
|
this.clearError();
|
||||||
|
|
||||||
const activeRequest = request({
|
const reqOpts = {
|
||||||
url: styleUrl,
|
url: styleUrl,
|
||||||
withCredentials: false,
|
withCredentials: false,
|
||||||
}, (error, response, body) => {
|
}
|
||||||
|
|
||||||
|
const activeRequest = request(reqOpts, (error, response, body) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
activeRequest: null
|
activeRequest: null,
|
||||||
|
activeRequestUrl: null
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!error && response.statusCode == 200) {
|
if (!error && response.statusCode == 200) {
|
||||||
@@ -94,7 +98,8 @@ class OpenModal extends React.Component {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
activeRequest: activeRequest
|
activeRequest: activeRequest,
|
||||||
|
activeRequestUrl: reqOpts.url
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,9 +203,9 @@ class OpenModal extends React.Component {
|
|||||||
onOpenToggle={() => this.onCancelActiveRequest()}
|
onOpenToggle={() => this.onCancelActiveRequest()}
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
Loading...
|
Loading: {this.state.activeRequestUrl}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p className="maputnik-dialog__buttons">
|
||||||
<Button onClick={(e) => this.onCancelActiveRequest(e)}>
|
<Button onClick={(e) => this.onCancelActiveRequest(e)}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -135,3 +135,9 @@
|
|||||||
color: $color-red;
|
color: $color-red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.maputnik-dialog {
|
||||||
|
&__buttons {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user