xmosaicframe: add url and xhr on context for view

authorSamuel Trégouët <samuel.tregouet@logilab.fr>
changeset555f771f0d2a
branchdefault
phasedraft
hiddenyes
parent revision#a142fc986d0c xmosaicframe: switch argument in done callback for ajax call
child revision#395e80e02de0 pdfview: add basic pdfview (closes #289639)
files modified by this revision
components/xmosaicframe/xmosaicframe.es6
# HG changeset patch
# User Samuel Trégouët <samuel.tregouet@logilab.fr>
# Date 1427976459 -7200
# Thu Apr 02 14:07:39 2015 +0200
# Node ID 555f771f0d2ab4d52a3bb6fb4485e636bda01215
# Parent a142fc986d0cefeb7996354b631c334b87f344e2
xmosaicframe: add url and xhr on context for view

diff --git a/components/xmosaicframe/xmosaicframe.es6 b/components/xmosaicframe/xmosaicframe.es6
@@ -138,10 +138,11 @@
1          }
2 
3          function httpFetch(baseurl, query) {
4              // join baseurl and query with a `/`
5              var url = baseurl.replace(/\/$/, '') + '/' + query.replace(/^\//, '');
6 +            frameContext.reqUrl = url;
7              return $.ajax({
8                  url: url,
9                  type: "HEAD"
10              });
11          }
@@ -198,10 +199,11 @@
12                  fetcher = httpFetch;
13              }
14              fetcher(host.dataset.baseurl, host.dataset.query)
15                  .done(function(data, status, xhr) {
16                      frameContext.rset = data;
17 +                    frameContext.xhr = xhr;
18                      let vid = host.dataset.vid || 'table';
19                      applyView(vid, frameContext);
20                  })
21                  .fail(function(xhr, err, msg) {
22                      console.log(xhr, err, msg);