From d9e2562f4b4447be8b44c69c0d523f832fa221f8 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sun, 17 Apr 2016 00:55:43 +0200 Subject: [PATCH] replace some item_photo_menu links so we can call js functions --- js/theme.js | 19 +++++++++++++++++++ templates/search_item.tpl | 4 ---- templates/wall_thread.tpl | 20 -------------------- theme.php | 24 ++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 24 deletions(-) diff --git a/js/theme.js b/js/theme.js index 9a4d2987b..57b67d2c7 100644 --- a/js/theme.js +++ b/js/theme.js @@ -269,6 +269,25 @@ function loadModalTitle() { } } + +function addToModal(url) { + var url = url + '?mode=modal'; + var modal = $('#modal').modal(); + + modal + .find('#modal-body') + .load(url, function (responseText, textStatus) { + if ( textStatus === 'success' || + textStatus === 'notmodified') + { + modal.show(); + + //Get first h3 element and use it as title + loadModalTitle(); + } + }); +}; + function editpost(url) { var modal = $('#jot-modal').modal(); var url = url + " #profile-jot-form"; diff --git a/templates/search_item.tpl b/templates/search_item.tpl index 937dbc5cc..c504a126a 100644 --- a/templates/search_item.tpl +++ b/templates/search_item.tpl @@ -240,10 +240,6 @@