summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-03-24 18:49:43 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-03-24 18:49:58 +0200
commit9101e28911a1f8edae956e7376008a092c5b3add (patch)
tree83368602698f3eb0ca101c52ee1907a67bd277e0
parentc9fec86a2d3d40fa190a297c55b5641679c4f097 (diff)
downloadaconf-9101e28911a1f8edae956e7376008a092c5b3add.tar.bz2
aconf-9101e28911a1f8edae956e7376008a092c5b3add.tar.xz
web client: preserve current view when reloading content
fixes the case where the first tab is automatically selected as the opening view
-rw-r--r--web/client.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/web/client.js b/web/client.js
index 67d8e18..3943417 100644
--- a/web/client.js
+++ b/web/client.js
@@ -53,14 +53,16 @@ require(
);
+ var objPath;
+
function renderObject(path, data) {
- path = path || navi.getPath();
+ if (path) objPath = path;
return (
- data ? $.Deferred().resolve(data) : txnMgr.query(path)
+ data ? $.Deferred().resolve(data) : txnMgr.query(objPath)
).done(function(data) {
var layout = data.meta.widget;
- var name = pth.split(path).pop();
+ var name = pth.split(objPath).pop();
(layout ?
require("aconf/layout/" + layout) :
Inline).extend({
@@ -73,7 +75,7 @@ require(
}
}).new(
{
- get: function(name) { return path; },
+ get: function(name) { return objPath; },
status: function(name) { return null; },
match: function(filter) { return true; }
},
@@ -84,7 +86,7 @@ require(
false
);
}).fail(function() {
- var comps = pth.split(path);
+ var comps = pth.split(objPath);
comps.pop();
comps.unshift("/");
navi.setPath(pth.join.apply(undefined, comps));