diff --git a/js/examples/chat/index.js b/js/examples/chat/index.js index 881606e..2d4f608 100644 --- a/js/examples/chat/index.js +++ b/js/examples/chat/index.js @@ -33,7 +33,7 @@ function spawnChatApp() { assert toBroker(url, present(this.nym, this.status)); during fromBroker(url, present($who, $status)) { - assert ui.context(who) + assert ui.context(who, status) .html('#nymlist', Mustache.render($('#nym_template').html(), { who: who, status: status })); } diff --git a/js/src/ui.js b/js/src/ui.js index 3eed014..3cd12a0 100644 --- a/js/src/ui.js +++ b/js/src/ui.js @@ -337,8 +337,9 @@ function Anchor(explicitFragmentId) { this.eventPattern = uiEvent(this.fragmentId, __, __, __); } -Anchor.prototype.context = function (contextId) { - return new Anchor(this.fragmentId + '_' + escapeDataAttributeName(contextId)); +Anchor.prototype.context = function (/* ... */) { + var extn = Array.prototype.slice.call(arguments).map(escapeDataAttributeName).join('__'); + return new Anchor(this.fragmentId + '__' + extn); }; Anchor.prototype.html = function (selector, html) {