aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/static/js/wiki/move.js
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-19 14:12:28 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-19 14:12:28 +0100
commite0f837ddd8ff434b1ef3429f6a709263350194ce (patch)
tree6f752fa2cb602d63dec09bb3f2d22ecce39d3d7c /pydis_site/static/js/wiki/move.js
parentInitial template cleanup (diff)
Move JS into files
Diffstat (limited to 'pydis_site/static/js/wiki/move.js')
-rw-r--r--pydis_site/static/js/wiki/move.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/pydis_site/static/js/wiki/move.js b/pydis_site/static/js/wiki/move.js
new file mode 100644
index 00000000..948917f6
--- /dev/null
+++ b/pydis_site/static/js/wiki/move.js
@@ -0,0 +1,10 @@
+$('#id_destination').after($('#dest_selector').remove());
+$('#id_destination').attr('type', 'hidden');
+$('#id_slug').val('{{ urlpath.slug }}');
+select_path('{{urlpath.parent.pk}}', '{{urlpath.parent}}');
+
+function select_path(path, title) {
+ $('#id_destination').val(path);
+ if (title == "(root)") title = "";
+ $('#dest_selector .dest_selector_title').html(title ? title : "&nbsp;&nbsp;/&nbsp;&nbsp;");
+}