xmosaicframe: add url and xhr on context for view

authorSamuel Trégouët <samuel.tregouet@logilab.fr>
changesetaaa19ec3d16d
branchdefault
phasedraft
hiddenyes
parent revision#4b24f468720b xmosaicframe: switch argument in done callback for ajax call
child revision#7c65356a52ff pdfview: add basic pdfview
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 aaa19ec3d16da2b29fc522762335e1c75c6c1153
# Parent 4b24f468720b06e9d591b7d2ecf2476d897783d4
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);