diff --git a/main/webapp/modules/core/externals/suggest/suggest-4_3.js b/main/webapp/modules/core/externals/suggest/suggest-4_3.js index bb10c3689..a630affc8 100644 --- a/main/webapp/modules/core/externals/suggest/suggest-4_3.js +++ b/main/webapp/modules/core/externals/suggest/suggest-4_3.js @@ -1299,6 +1299,20 @@ name.append($("").text(data.description)); } + // If we know of a view URL for this suggest service, + // clicking with the middle button sends the user to + // the view page. + if('view_url' in this.options && data.id) { + var view_url = this.options.view_url.replace('{{id}}', data.id); + li.on('mousedown', function(e) { + if (e.which == 2) { + var win = window.open(view_url, '_blank'); + win.focus(); + e.preventDefault(); + } + }); + } + //console.log("create_item", li); return li; }, diff --git a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js index be5a9d29f..e399737e5 100644 --- a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js +++ b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js @@ -200,6 +200,9 @@ DataTableCellUI.prototype._render = function() { var addSuggest = false; if ((service) && (service.suggest) && (service.suggest.entity)) { suggestOptions = service.suggest.entity; + if ('view' in service && 'url' in service.view && !('view_url' in suggestOptions)) { + suggestOptions.view_url = service.view.url; + } addSuggest = true; } diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js b/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js index 7845334fd..ffd021c3f 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js @@ -85,6 +85,9 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { if (service && service.suggest && service.suggest.entity) { suggestOptions = $.extend({}, service.suggest.entity); suggestOptions.query_param_name = "prefix"; + if ('view' in service && 'url' in service.view && !('view_url' in suggestOptions)) { + suggestOptions.formatter_url = service.view.url; + } } var frame = DialogSystem.createDialog();