X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widgets.js;h=517850bc3dbcb85cd7dd800540e7b1435206e660;hb=df823384f61228cdcedc53999e44dc4704c858f9;hp=06047f15742151dc74509d7bc6dfe22026e61d8b;hpb=a3c438c4ed667814496a2f5948162ad4d5644320;p=mkws-moved-to-github.git diff --git a/src/mkws-widgets.js b/src/mkws-widgets.js index 06047f1..517850b 100644 --- a/src/mkws-widgets.js +++ b/src/mkws-widgets.js @@ -237,6 +237,7 @@ mkws.registerWidgetType('Records', function() { var html = []; for (var i = 0; i < data.hits.length; i++) { var hit = data.hits[i]; + that.team.queue("record").publish(hit); var divId = team.recordElementId(hit.recid[0]); html.push('
', renderSummary(hit), '
'); // ### At some point, we may be able to move the @@ -267,28 +268,21 @@ mkws.registerWidgetType('Navi', function() { var M = mkws.M; this.team.queue("navi").subscribe(function() { - // This is very low-level poking around inside the filter structure - var list = that.team.filters().list(); + var filters = that.team.filters(); var text = ""; - for (var i in list) { - var filter = list[i]; - if (filter.id) { - if (text) text += " | "; - text += M('source') + ': ' + filter.name + ''; - } - } - - for (var i in list) { - var filter = list[i]; - if (!filter.id) { - if (text) text += " | "; - text += M(filter.field) + ': ' + filter.value + ''; - } - } + filters.visitTargets(function(id, name) { + if (text) text += " | "; + text += M('source') + ': ' + name + ''; + }); + + filters.visitFields(function(field, value) { + if (text) text += " | "; + text += M(field) + ': ' + value + ''; + }); $(that.node).html(text); });