Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions scout-ui/src/field-list/type-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var $ = require('jquery');
var format = require('util').format;
var _ = require('underscore');
var numeral = require('numeral');
var debug = require('debug')('scout-ui:field-list:type-list-item');

require('bootstrap/js/tooltip');

Expand All @@ -19,16 +20,6 @@ module.exports = AmpersandView.extend({
}
}
],
'model.probability': [
{
hook: 'bar',
type: function(el) {
$(el).css({
width: Math.floor(this.model.probability * 100) + '%'
});
}
}
]
},
events: {
'click .schema-field-wrapper': 'typeClicked'
Expand All @@ -46,6 +37,9 @@ module.exports = AmpersandView.extend({
$(this.el).tooltip({
title: format('%s (%s)', this.model.getId(), numeral(this.model.probability).format('%'))
});
$(this.queryByHook('bar')).css({
width: Math.floor(this.model.probability * 100) + '%'
});
}.bind(this), 300));
},
template: require('./type-list-item.jade'),
Expand All @@ -54,6 +48,9 @@ module.exports = AmpersandView.extend({
if (!fieldList.minichartModel || (fieldList.minichartModel.modelType !== this.model.modelType)) {
fieldList.switchView(this.model);
}
},
render: function() {
this.renderWithTemplate(this);
return this;
}

});
26 changes: 13 additions & 13 deletions scout-ui/src/home/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ module.exports = AmpersandView.extend({
hook: 'stats-subview',
prepareView: function(el) {
return new CollectionStatsView({
el: el,
parent: this,
model: this.model
});
el: el,
parent: this,
model: this.model
});
}
},
fields: {
Expand All @@ -84,21 +84,21 @@ module.exports = AmpersandView.extend({
hook: 'refine-bar',
prepareView: function(el) {
return new RefineBarView({
el: el,
parent: this,
model: app.queryOptions
});
el: el,
parent: this,
model: app.queryOptions
});
}
},
documents: {
waitFor: 'model.documents',
waitFor: 'open',
hook: 'documents-subview',
prepareView: function(el) {
return new DocumentListView({
el: el,
parent: this,
collection: this.model.documents
});
el: el,
parent: this,
collection: this.model.documents
});
}
}
}
Expand Down
34 changes: 15 additions & 19 deletions scout-ui/src/minicharts/viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ module.exports = AmpersandView.extend({
},

initialize: function(opts) {
if (this.model !== undefined) {
this.listenTo(this.model, 'change', this.redraw);
}

if (this.width === 'auto' || this.width === undefined) {
this._autoWidth = true;
Expand Down Expand Up @@ -134,23 +131,22 @@ module.exports = AmpersandView.extend({
});
}
return this;
},

redraw: function() {
this._chooseDataSource();
this.data = this.transform(this.data);

this._measure();

if (this.vizFn) {
this.vizFn({
width: this.width,
height: this.height,
data: this.data,
el: this.el,
});
}
}
// redraw: function() {
// this._chooseDataSource();
// this.data = this.transform(this.data);
//
// this._measure();
//
// if (this.vizFn) {
// this.vizFn({
// width: this.width,
// height: this.height,
// data: this.data,
// el: this.el,
// });
// }
// }
});

/**
Expand Down