Skip to content

Commit b74dabb

Browse files
committed
more consistent tab UX
1 parent fbcc843 commit b74dabb

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

packages/pico-engine/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ <h2>Children</h2>
352352
<ul class="subscriptions-list" style="list-style: none;padding:0">
353353
{{#each subscriptions}}
354354
<li><input type="checkbox"> to pico "{{name}}" (did:npe:{{Tx}})
355-
<a href="/sky/event/{{../eci}}/delete-subscription/wrangler/subscription_cancellation?Tx={{this.Tx}}">del</a>
355+
<a class="js-ajax-link" href="/sky/event/{{../eci}}/delete-subscription/wrangler/subscription_cancellation?Rx={{this.Rx}}">del</a>
356356
<pre>{{this.asString}}</pre>
357357
</li>
358358
{{/each}}

packages/pico-engine/public/js/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
8787
var eci = findEciById(thePicoInp.id);
8888
if (label === "About") {
8989
var thePicoOut = {};
90+
thePicoOut.pico_id = thePicoInp.id;
9091
thePicoOut.id = thePicoInp.id;
9192
thePicoOut.eci = eci;
9293
var pp_eci = getP(thePicoInp,"parent_eci",undefined);
@@ -152,6 +153,7 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
152153
} else if (label === "Logging") {
153154
var logRID = "io.picolabs.logging";
154155
var theLoggingOut = {};
156+
theLoggingOut.pico_id = thePicoInp.id;
155157
if (get(db_dump,["pico",thePicoInp.id,"ruleset",logRID,"on"])) {
156158
var theLoggingVars = get(db_dump,["pico",thePicoInp.id,logRID,"vars"]);
157159
theLoggingOut.status = theLoggingVars.status;
@@ -179,7 +181,7 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
179181
theChannels.push(aChannel);
180182
}
181183
});
182-
callback({ "id": thePicoInp.id, "eci": thePicoInp.admin_eci, "channel": theChannels });
184+
callback({ "pico_id": thePicoInp.id, "id": thePicoInp.id, "eci": thePicoInp.admin_eci, "channel": theChannels });
183185
} else if (label == "Subscriptions") {
184186
var theSubscriptions = {};
185187
var subscriptionsCount = 0;
@@ -194,7 +196,7 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
194196
theSubscriptions[id].name = getV(pico,"dname");
195197
});
196198
}
197-
callback({eci:eci,"subscriptions":subscriptionsCount ? theSubscriptions : false});
199+
callback({"pico_id": thePicoInp.id, eci:eci,"subscriptions":subscriptionsCount ? theSubscriptions : false});
198200
} else {
199201
callback(thePicoInp);
200202
}
@@ -290,9 +292,14 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
290292
{ swatches: "#ccc|#fcc|#7fffd4|#ccf|#ffc|#87CEFA|#fcf".split('|')});
291293
$('.minicolors-input-swatch').css('top',0);
292294
$('.minicolors-input-swatch').css('left',0);
293-
d = theDB.id+"-About";
295+
d = theDB.pico_id+"-About";
296+
location.hash = d;
294297
} else if(liContent === "channels") {
295-
d = theDB.id+"-Channels";
298+
d = theDB.pico_id+"-Channels";
299+
location.hash = d;
300+
} else if(liContent === "subscriptions") {
301+
d = theDB.pico_id+"-Subscriptions";
302+
location.hash = d;
296303
} else if(liContent === "logging") {
297304
$("#logging-on").click(function(){
298305
$.getJSON("/sky/event/"+theDB.eci+"/logging-on/picolog/begin",function(){
@@ -306,6 +313,8 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
306313
$("#logging-list").hide();
307314
$.getJSON("/sky/event/"+theDB.eci+"/logging-on/picolog/reset",function(){ });
308315
});
316+
d = theDB.pico_id+"-Logging";
317+
location.hash = d;
309318
}
310319
$theSection.find('.js-ajax-form').submit(function(e){
311320
e.preventDefault();

0 commit comments

Comments
 (0)