summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/tools/wtstats/template/views/stat.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/tools/wtstats/template/views/stat.js')
-rw-r--r--src/third_party/wiredtiger/tools/wtstats/template/views/stat.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/tools/wtstats/template/views/stat.js b/src/third_party/wiredtiger/tools/wtstats/template/views/stat.js
new file mode 100644
index 00000000000..a327503e8c9
--- /dev/null
+++ b/src/third_party/wiredtiger/tools/wtstats/template/views/stat.js
@@ -0,0 +1,30 @@
+var AmpersandView = require('ampersand-view'),
+ debug = require('debug')('view:stat');
+
+var StatView = module.exports = AmpersandView.extend({
+ template: require('./templates/stat.jade'),
+ render: function () {
+ this.renderWithTemplate(this.model);
+ },
+ events: {
+ 'click': 'clicked',
+ },
+ bindings: {
+ 'model.selected': {
+ type: 'booleanClass',
+ hook: 'circle',
+ yes: 'fa-circle',
+ no: 'fa-circle-o'
+ }
+ },
+ clicked: function (event) {
+ // ignore shift+click, app handles those
+ if (event.shiftKey) {
+ this.model.app.toggleAllExcept(this.model);
+ } else {
+ this.model.app.clearSelectionState();
+ this.model.toggle('selected');
+ }
+ this.parent.parent.statChanged(this, {all: event.shiftKey, propagate: true});
+ }
+});