From 04ec35d9cc39cbf62c8db2818574c1f6d56f2a20 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 25 Feb 2018 19:25:00 -0800 Subject: hubzilla issue #979 - alter image selection widget to accept/submit on choose (jot, wiki, cover_photo, profile_photo) --- view/js/mod_cover_photo.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'view/js/mod_cover_photo.js') diff --git a/view/js/mod_cover_photo.js b/view/js/mod_cover_photo.js index b9af8ce5c..5b64b8b91 100644 --- a/view/js/mod_cover_photo.js +++ b/view/js/mod_cover_photo.js @@ -27,13 +27,7 @@ if (typeof($(image).parent()[0]) !== 'undefined') { var imageparent = document.getElementById($(image).parent()[0].id); $(imageparent).toggleClass('embed-photo-selected-photo'); - } - }); - $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); - $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); - $('#embed-photo-OKButton').click(function () { - $('.embed-photo-selected-photo').each(function (index) { - var href = $(this).attr('href'); + var href = $(imageparent).attr('href'); $.post("embedphotos/photolink", {href: href}, function(ddata) { if (ddata['status']) { @@ -42,13 +36,16 @@ window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); } return false; - }, - 'json'); - }); - $('#embedPhotoModalBodyAlbumDialog').html(''); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal('hide'); + }, + 'json'); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + } }); + + $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); } else { window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); } -- cgit v1.2.3