From ed092a58877bd60c70797f0619a979bd7b780679 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 2 Apr 2015 08:37:13 +0000 Subject: [PATCH] Trigger expose view by clicking on link-list's links --- etemplate/js/et2_widget_link.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index 16425f2991..30bef8c843 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -1748,7 +1748,18 @@ var et2_link_list = et2_link_string.extend( $j(document.createElement("td")) .appendTo(row) .addClass(columns[i]) - .click( function(){self.egw().open(_link_data, "", "view",null,_link_data.target ? _link_data.target : _link_data.app,_link_data.app);}) + .click( function(){ + // Check if the link entry is mime with media type, in order to open it in expose view + if (typeof _link_data.type != 'undefined' && _link_data.type.match(self.mime_regexp,'ig')) + { + var $vfs_img_node = jQuery(this).parent().find('.vfsMimeIcon'); + if ($vfs_img_node.length > 0) $vfs_img_node.click(); + } + else + { + self.egw().open(_link_data, "", "view",null,_link_data.target ? _link_data.target : _link_data.app,_link_data.app); + } + }) .text(_link_data[columns[i]] ? _link_data[columns[i]]+"" : ""); }