aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-06-23 17:01:43 +0000
committerMario <mario@mariovavti.com>2022-06-23 17:01:43 +0000
commit7602de85c3c9e1bfd05534ec01191bc26c00ee94 (patch)
tree9e50a6e7b0e636aba4fd88c62be0820e89fb58a9 /view
parente030648957bac514d40ced8a5dc6cbfb8706e32a (diff)
downloadvolse-hubzilla-7602de85c3c9e1bfd05534ec01191bc26c00ee94.tar.gz
volse-hubzilla-7602de85c3c9e1bfd05534ec01191bc26c00ee94.tar.bz2
volse-hubzilla-7602de85c3c9e1bfd05534ec01191bc26c00ee94.zip
make sure the document is loaded
Diffstat (limited to 'view')
-rw-r--r--view/tpl/contact_edit_modal.tpl29
1 files changed, 15 insertions, 14 deletions
diff --git a/view/tpl/contact_edit_modal.tpl b/view/tpl/contact_edit_modal.tpl
index ddb1557c1..72feb7138 100644
--- a/view/tpl/contact_edit_modal.tpl
+++ b/view/tpl/contact_edit_modal.tpl
@@ -24,29 +24,24 @@
</div>
</div>
<script>
+
let poi;
let section = 'roles';
let sub_section;
-
- $('#edit-modal').on('hidden.bs.modal', function (e) {
- if (window.location.hash) {
- history.replaceState(null, '', 'connections');
- }
- })
-
- if (window.location.hash) {
- poi = window.location.hash.substr(1);
- init_contact_edit(poi);
- }
-
- window.onhashchange = function() {
+ $(document).ready(function() {
if (window.location.hash) {
poi = window.location.hash.substr(1);
init_contact_edit(poi);
}
- };
+ window.onhashchange = function() {
+ if (window.location.hash) {
+ poi = window.location.hash.substr(1);
+ init_contact_edit(poi);
+ }
+ };
+ });
$(document).on('click', '.contact-edit', function (e) {
e.preventDefault();
@@ -101,6 +96,12 @@
}
});
+ $('#edit-modal').on('hidden.bs.modal', function (e) {
+ if (window.location.hash) {
+ history.replaceState(null, '', 'connections');
+ }
+ });
+
function init_contact_edit(poi) {
if (!poi)
return;