-
Notifications
You must be signed in to change notification settings - Fork 0
/
eeplus-image-preview.js
28 lines (27 loc) · 1.02 KB
/
eeplus-image-preview.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
EasyEdit.plugins.imagePreview = {
init: function() {
var self = this;
EasyEditEventManager.bind('AssetFinderAfterInit', function() {
$(document).on("click", "#ees_assetFinderBody a",
function(e) {
setThumb('http://www.yoursite.com');
});
});
}
};
function setThumb(siteURL) {
if ($('#ees_assetFinderBody .selected .assetIcon').hasClass("image")) {
$('#preview-image').remove();
var assetidsel = $('.currentSelectionId').text();
var assetidrem = $.trim(assetidsel);
var assetid = assetidrem.replace('#', '');
var asseturl = siteURL + '?a=' + assetid;
var assethtml =
'<div style="border:1px solid #000; width:200px;" id="preview-image"><img src="' +
asseturl + '" width="200"/></div>';
$('#ees_assetFinderFooter').append(assethtml);
}
if (!$('#ees_assetFinderBody .selected .assetIcon').hasClass("image")) {
$('#preview-image').remove();
}
}