aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
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;