Skip to content
Snippets Groups Projects
Commit 213fc02d authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[enh] ES Document search: open JSON document on item click

parent f4396a9f
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ angular.module('cesium.es.document.controllers', ['cesium.es.services'])
;
function ESDocumentLookupController($scope, $ionicPopover, $location, $timeout,
csSettings, csWallet, UIUtils, esDocument) {
csSettings, csWallet, UIUtils, esHttp, esDocument) {
'ngInject';
$scope.search = {
......@@ -157,8 +157,11 @@ function ESDocumentLookupController($scope, $ionicPopover, $location, $timeout,
});
};
$scope.selectDocument = function(doc) {
console.debug("Selected document: ", doc);
$scope.selectDocument = function(event, doc) {
console.debug("Selected document: ", doc, esHttp);
var url = esHttp.getUrl('/{0}/{1}/_search?pretty&q=_id:{2}'.format(doc.index, doc.type, doc.id));
return $scope.openLink(event, url);
};
$scope.toggleSort = function(sort){
......
<ion-item id="doc-{{::doc.id}}"
class="item item-document item-icon-left ink {{::ionItemClass}} no-padding-top no-padding-bottom"
ng-click="selectDocument(doc)">
ng-click="selectDocument($event, doc)">
<i class="icon ion-document stable" ng-if=":rebind:!doc.avatar"></i>
<i class="avatar" ng-if=":rebind:doc.avatar" style="background-image: url('{{:rebind:doc.avatar.src}}')"></i>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment