[#77,model][s]: add summary function to product infobox style summary for a doc (all keys and values atm).
This commit is contained in:
parent
6f31228520
commit
2a7807638b
10
src/model.js
10
src/model.js
@ -198,6 +198,16 @@ my.Document = Backbone.Model.extend({
|
||||
val = field.renderer(val, field, this);
|
||||
}
|
||||
return val;
|
||||
},
|
||||
|
||||
summary: function(fields) {
|
||||
var html = '';
|
||||
for (key in this.attributes) {
|
||||
if (key != 'id') {
|
||||
html += '<div><strong>' + key + '</strong>: '+ this.attributes[key] + '</div>';
|
||||
}
|
||||
}
|
||||
return html;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user