"reset=1&id=$fileID&eid=$contactID",
$absolute, NULL, TRUE, TRUE
);
- $result['file_url'] = "<a href='javascript:imagePopUp(\"$url\");'><img src=\"$url\" width=$imageThumbWidth height=$imageThumbHeight/></a>";
+ $result['file_url'] = "
+ <a href=\"$url\" class='crm-image-popup'>
+ <img src=\"$url\" width=$imageThumbWidth height=$imageThumbHeight/>
+ </a>";
// for non image files
}
else {
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=420,left = 202,top = 184');");
}
-function imagePopUp(path) {
- window.open(path, 'popupWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,screenX=150,screenY=150,top=150,left=150');
-}
-
/**
* Function to show / hide the row in optionFields
*
messagesFromMarkup.call($('#crm-container'));
$('#crm-container').on('crmFormLoad', '*', messagesFromMarkup);
}
+
+ // bind the event for image popup
+ $('body').on('click', 'a.crm-image-popup', function() {
+ var o = $('<div class="crm-container crm-custom-image-popup"><img src=' + $(this).attr('href') + '></div>');
+
+ CRM.confirm('',
+ {
+ title: ts('Preview'),
+ message: o
+ },
+ ts('Done')
+ );
+ return false;
+ });
});
$.fn.crmAccordions = function (speed) {
{if $element.field_type == 'File'}
{if $element.field_value.displayURL}
<td class="html-adjust">
- <a href="#" onclick="imagePopUp('{$element.field_value.imageURL}'); return false;">
- <img src="{$element.field_value.displayURL}" height = "100" width="100">
+ <a href="{$element.field_value.displayURL}" class='crm-image-popup'>
+ <img src="{$element.field_value.displayURL}" height = "100" width="100">
</a>
</td>
{else}
{if $element.field_type == 'File'}
{if $element.field_value.displayURL}
<div class="crm-content crm-custom_data crm-displayURL">
- <a href="#" onclick="imagePopUp('{$element.field_value.imageURL}'); return false;" ><img src="{$element.field_value.displayURL}" height = "{$element.field_value.imageThumbHeight}" width="{$element.field_value.imageThumbWidth}"></a>
+ <a href="{$element.field_value.displayURL}" class='crm-image-popup'>
+ <img src="{$element.field_value.displayURL}" height = "{$element.field_value.imageThumbHeight}"
+ width="{$element.field_value.imageThumbWidth}">
+ </a>
</div>
{else}
<div class="crm-content crm-custom_data crm-fileURL">
<span class="html-adjust"><br />
{ts}Attached File{/ts}:
{if $element.element_value.displayURL}
- <a href="#" onclick="popUp('{$element.element_value.imageURL}'); return false;" ><img src="{$element.element_value.displayURL}" height = "{$element.element_value.imageThumbHeight}" width="{$element.element_value.imageThumbWidth}"></a>
+ <a href="{$element.element_value.displayURL}" class='crm-image-popup'>
+ <img src="{$element.element_value.displayURL}"
+ height = "{$element.element_value.imageThumbHeight}"
+ width="{$element.element_value.imageThumbWidth}">
+ </a>
{else}
<a href="{$element.element_value.fileURL}">{$element.element_value.fileName}</a>
{/if}
<td class="label">{$element.field_title}</td>
{if $element.field_type == 'File'}
{if $element.field_value.displayURL}
- <td class="html-adjust"><a href="#"
- onclick="imagePopUp('{$element.field_value.imageURL}'); return false;"><img
- src="{$element.field_value.displayURL}" height="100" width="100"></a></td>
+ <td class="html-adjust">
+ <a href="{$element.field_value.displayURL}" class='crm-image-popup'>
+ <img src="{$element.field_value.displayURL}" height="100" width="100">
+ </a>
+ </td>
{else}
- <td class="html-adjust"><a
- href="{$element.field_value.fileURL}">{$element.field_value.fileName}</a></td>
+ <td class="html-adjust">
+ <a href="{$element.field_value.fileURL}">{$element.field_value.fileName}</a>
+ </td>
{/if}
{else}
{if $element.field_data_type == 'Money'}