11454: Replaced javascript events with proper form values
[arvados.git] / apps / workbench / app / assets / javascripts / components / search.js
index 51d352ab829b065c8ec932c10eff498262b40f1a..2f37d781ae9439eed480b5dcacfe713351a030f6 100644 (file)
@@ -57,20 +57,24 @@ window.SearchResultsTable = {
                     // Add the salted token to search result links from federated
                     // remote hosts.
                     if (!session.isFromRails && session.token.indexOf('v2/') == 0) {
-                        tokenParam = '?api_token='+session.token
+                        tokenParam = session.token
                     }
                     return m('tr', [
-                        m('td', [
+                        m('td', m('form', {
+                            action: item.workbenchBaseURL() + '/' + item.objectType.wb_path + '/' + item.uuid,
+                            method: 'GET'
+                        }, [
+                            tokenParam !== '' &&
+                                m('input[type=hidden][name=api_token][value='+tokenParam+']'),
                             item.workbenchBaseURL() &&
-                                m('a.btn.btn-xs.btn-default', {
+                                m('button.btn.btn-xs.btn-default[type=submit]', {
                                     'data-original-title': 'show '+item.objectType.description,
                                     'data-placement': 'top',
                                     'data-toggle': 'tooltip',
-                                    href: item.workbenchBaseURL()+'/'+item.objectType.wb_path+'/'+item.uuid+tokenParam,
                                     // Bootstrap's tooltip feature
                                     oncreate: function(vnode) { $(vnode.dom).tooltip() },
                                 }, iconsMap[item.objectType.wb_path]),
-                        ]),
+                        ])),
                         m('td.arvados-uuid', item.uuid),
                         m('td', item.name || '(unnamed)'),
                         m('td', m(LocalizedDateTime, {parse: item.modified_at})),