Unbind reveal event before open it in case one was already opened
This commit is contained in:
parent
0145b55a5c
commit
d8df14faf9
1 changed files with 7 additions and 2 deletions
|
@ -49,10 +49,15 @@
|
||||||
if (e.cssClass) {
|
if (e.cssClass) {
|
||||||
$div.addClass(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();
|
return $div.empty().html(e.data.html).append('<a class="close-reveal-modal">×</a>').reveal();
|
||||||
});
|
});
|
||||||
L.Chickpea.on('modal_close', function (e) {
|
L.Chickpea.on('modal_close', function (e) {
|
||||||
var $div = $('#reveal-container').trigger('reveal:close');
|
var $div = $('#reveal-container')
|
||||||
|
if ($div) {
|
||||||
|
$div.trigger('reveal:close');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
L.Chickpea.on('alert', function (e) {
|
L.Chickpea.on('alert', function (e) {
|
||||||
var level_class = e.level && e.level == "info"? "success": "alert";
|
var level_class = e.level && e.level == "info"? "success": "alert";
|
||||||
|
@ -67,6 +72,6 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<div id="reveal-container" class="reveal-modal"></div>
|
<div id="reveal-container"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue