aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/includes/modals.html
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-08 14:06:11 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-08 14:06:11 +0100
commit027475779bfa7db50a1c1ff9935bcb546b33f961 (patch)
tree1782c502797f4e1cea5a876dcb4b51f99e4a8ba1 /pydis_site/templates/wiki/includes/modals.html
parentRemove wiki host, use /wiki - Also some wiki config (diff)
Add base templates for django-wiki, as provided
Diffstat (limited to 'pydis_site/templates/wiki/includes/modals.html')
-rw-r--r--pydis_site/templates/wiki/includes/modals.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/pydis_site/templates/wiki/includes/modals.html b/pydis_site/templates/wiki/includes/modals.html
new file mode 100644
index 00000000..b86d4f65
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/modals.html
@@ -0,0 +1,31 @@
+{% load sekizai_tags static %}
+{% addtoblock "js" %}
+<script type="text/javascript" src="{% static "wiki/js/jquery-ui-1.12.1.custom/jquery-ui.min.js" %}"></script>
+<script type="text/javascript">
+$(document).ready(function() {
+ $(".modal-content").on("resizestart", function(event, ui) {
+ $(ui.element).find(".modal-body, iframe").each(function() {
+ elem = $(this);
+ elem.data("resizeoriginalheight", elem.height());
+ });
+ });
+
+ $(".modal-content").on("resize", function(event, ui) {
+ ui.element.parents('.modal-dialog').css("margin-left", -ui.size.width/2);
+ ui.element.parents('.modal-dialog').css("margin-top", -ui.size.height/2);
+ ui.element.parents('.modal-dialog').css("top", "50%");
+ ui.element.parents('.modal-dialog').css("left", "50%");
+
+ $(ui.element).find(".modal-body,iframe").each(function() {
+ elem = $(this);
+ $(this).css("min-height", elem.data("resizeoriginalheight") + ui.size.height - ui.originalSize.height);
+ });
+ });
+
+ $(".modal-content").resizable();
+});
+</script>
+{% endaddtoblock %}
+{% addtoblock "css" %}
+<link rel="stylesheet" href="{% static "wiki/js/jquery-ui-1.12.1.custom/jquery-ui.min.css" %}" type="text/css" />
+{% endaddtoblock %}