Follow Leaflet.Storage UI refactoring
cf umap-project/Leaflet.Storage/commit/59583db7bef28b2fd13ac98c0a62e1a770d3fb66
This commit is contained in:
parent
e2dfcdb336
commit
5aa853761c
3 changed files with 12 additions and 6 deletions
|
@ -172,6 +172,11 @@ ul {
|
|||
.tintbox p {
|
||||
color: #6f6f6f;
|
||||
}
|
||||
body.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -22,9 +22,6 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
</head>
|
||||
<body class="{% block body_class %}{% endblock %}">
|
||||
<div id="storage-ui-container"></div>
|
||||
<div id="storage-alert-container"></div>
|
||||
<div id="storage-tooltip-container"></div>
|
||||
|
||||
{% block header %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -23,11 +23,14 @@
|
|||
{% block bottom_js %}
|
||||
{{ block.super }}
|
||||
<script type="text/javascript">
|
||||
!(function() {
|
||||
var ui = new L.S.UI(document.body);
|
||||
var xhr = new L.S.Xhr(ui);
|
||||
var login = document.querySelector('a.login');
|
||||
if (login) {
|
||||
L.DomEvent.on(login, 'click', function (e) {
|
||||
L.DomEvent.stop(e);
|
||||
L.Storage.Xhr.login({
|
||||
xhr.login({
|
||||
"login_required": this.getAttribute('href'),
|
||||
"redirect": "/"
|
||||
});
|
||||
|
@ -37,12 +40,12 @@
|
|||
if (logout) {
|
||||
L.DomEvent.on(logout, 'click', function (e) {
|
||||
L.DomEvent.stop(e);
|
||||
L.Storage.Xhr.logout(this.getAttribute('href'));
|
||||
xhr.logout(this.getAttribute('href'));
|
||||
});
|
||||
}
|
||||
var getMore = function (e) {
|
||||
L.DomEvent.stop(e);
|
||||
L.S.Xhr._ajax({
|
||||
xhr._ajax({
|
||||
uri: this.href,
|
||||
verb: 'GET',
|
||||
callback: function (data) {
|
||||
|
@ -63,6 +66,7 @@
|
|||
if (more) {
|
||||
L.DomEvent.on(more, 'click', getMore, more);
|
||||
}
|
||||
})(this);
|
||||
</script>
|
||||
{% endblock bottom_js %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue