Use Storage contrib foundation file
This commit is contained in:
parent
9ffc90ba1a
commit
211942830f
2 changed files with 1 additions and 46 deletions
|
@ -37,40 +37,9 @@
|
|||
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.accordion.js"></script>
|
||||
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.placeholder.js"></script>
|
||||
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.alerts.js"></script>
|
||||
<script src="{{ STATIC_URL }}storage/contrib/js/storage.foundation.js"></script>
|
||||
<script src="{{ STATIC_URL }}endless_pagination/js/endless-pagination.js"></script>
|
||||
{% block bottom_js %}
|
||||
<script type="text/javascript">
|
||||
$(document).foundationAlerts();
|
||||
L.Storage.on('modal_ready', function (e) {
|
||||
var $div = $('#reveal-container');
|
||||
// reset class
|
||||
$div.attr("class", "");
|
||||
$div.addClass("reveal-modal");
|
||||
if (e.cssClass) {
|
||||
$div.addClass(e.cssClass);
|
||||
}
|
||||
// in case a modal is already opened with same id, unbind
|
||||
$div.unbind('.reveal');
|
||||
return $div.empty().html(e.data.html).append('<a class="close-reveal-modal">×</a>').reveal();
|
||||
});
|
||||
L.Storage.on('modal_close', function (e) {
|
||||
var $div = $('#reveal-container')
|
||||
if ($div) {
|
||||
$div.trigger('reveal:close');
|
||||
}
|
||||
});
|
||||
L.Storage.on('alert', function (e) {
|
||||
var level_class = e.level && e.level == "info"? "success": "alert";
|
||||
$div = $('<div>').addClass('alert-box global').addClass(level_class).html(e.content);
|
||||
$div.append('<a href="#" class="close">×</a>');
|
||||
$("body").prepend($div);
|
||||
});
|
||||
$('a.reveal').click(function(e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
L.Storage.Xhr.get($this.attr('href'));
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
<div id="reveal-container"></div>
|
||||
</body>
|
||||
|
|
|
@ -123,19 +123,5 @@
|
|||
{{ block.super }}
|
||||
<script type="text/javascript">
|
||||
$.endlessPaginate({paginateOnScroll: true});
|
||||
$(document).ready(function(e){
|
||||
$('a.login_button').click(function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
L.Storage.Xhr.login({"login_required": $this.attr('href')});
|
||||
});
|
||||
});
|
||||
$(document).ready(function(e){
|
||||
$('a.logout_button').click(function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
L.Storage.Xhr.logout($this.attr('href'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock bottom_js %}
|
Loading…
Reference in a new issue