File tree Expand file tree Collapse file tree 3 files changed +36
-43
lines changed Expand file tree Collapse file tree 3 files changed +36
-43
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ var $ = require('jquery');
3
3
var format = require ( 'util' ) . format ;
4
4
var _ = require ( 'underscore' ) ;
5
5
var numeral = require ( 'numeral' ) ;
6
+ var debug = require ( 'debug' ) ( 'scout-ui:field-list:type-list-item' ) ;
6
7
7
8
require ( 'bootstrap/js/tooltip' ) ;
8
9
@@ -19,16 +20,6 @@ module.exports = AmpersandView.extend({
19
20
}
20
21
}
21
22
] ,
22
- 'model.probability' : [
23
- {
24
- hook : 'bar' ,
25
- type : function ( el ) {
26
- $ ( el ) . css ( {
27
- width : Math . floor ( this . model . probability * 100 ) + '%'
28
- } ) ;
29
- }
30
- }
31
- ]
32
23
} ,
33
24
events : {
34
25
'click .schema-field-wrapper' : 'typeClicked'
@@ -46,6 +37,9 @@ module.exports = AmpersandView.extend({
46
37
$ ( this . el ) . tooltip ( {
47
38
title : format ( '%s (%s)' , this . model . getId ( ) , numeral ( this . model . probability ) . format ( '%' ) )
48
39
} ) ;
40
+ $ ( this . queryByHook ( 'bar' ) ) . css ( {
41
+ width : Math . floor ( this . model . probability * 100 ) + '%'
42
+ } ) ;
49
43
} . bind ( this ) , 300 ) ) ;
50
44
} ,
51
45
template : require ( './type-list-item.jade' ) ,
@@ -54,6 +48,9 @@ module.exports = AmpersandView.extend({
54
48
if ( ! fieldList . minichartModel || ( fieldList . minichartModel . modelType !== this . model . modelType ) ) {
55
49
fieldList . switchView ( this . model ) ;
56
50
}
51
+ } ,
52
+ render : function ( ) {
53
+ this . renderWithTemplate ( this ) ;
54
+ return this ;
57
55
}
58
-
59
56
} ) ;
Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ module.exports = AmpersandView.extend({
62
62
hook : 'stats-subview' ,
63
63
prepareView : function ( el ) {
64
64
return new CollectionStatsView ( {
65
- el : el ,
66
- parent : this ,
67
- model : this . model
68
- } ) ;
65
+ el : el ,
66
+ parent : this ,
67
+ model : this . model
68
+ } ) ;
69
69
}
70
70
} ,
71
71
fields : {
@@ -84,21 +84,21 @@ module.exports = AmpersandView.extend({
84
84
hook : 'refine-bar' ,
85
85
prepareView : function ( el ) {
86
86
return new RefineBarView ( {
87
- el : el ,
88
- parent : this ,
89
- model : app . queryOptions
90
- } ) ;
87
+ el : el ,
88
+ parent : this ,
89
+ model : app . queryOptions
90
+ } ) ;
91
91
}
92
92
} ,
93
93
documents : {
94
- waitFor : 'model.documents ' ,
94
+ waitFor : 'open ' ,
95
95
hook : 'documents-subview' ,
96
96
prepareView : function ( el ) {
97
97
return new DocumentListView ( {
98
- el : el ,
99
- parent : this ,
100
- collection : this . model . documents
101
- } ) ;
98
+ el : el ,
99
+ parent : this ,
100
+ collection : this . model . documents
101
+ } ) ;
102
102
}
103
103
}
104
104
}
Original file line number Diff line number Diff line change @@ -51,9 +51,6 @@ module.exports = AmpersandView.extend({
51
51
} ,
52
52
53
53
initialize : function ( opts ) {
54
- if ( this . model !== undefined ) {
55
- this . listenTo ( this . model , 'change' , this . redraw ) ;
56
- }
57
54
58
55
if ( this . width === 'auto' || this . width === undefined ) {
59
56
this . _autoWidth = true ;
@@ -134,23 +131,22 @@ module.exports = AmpersandView.extend({
134
131
} ) ;
135
132
}
136
133
return this ;
137
- } ,
138
-
139
- redraw : function ( ) {
140
- this . _chooseDataSource ( ) ;
141
- this . data = this . transform ( this . data ) ;
142
-
143
- this . _measure ( ) ;
144
-
145
- if ( this . vizFn ) {
146
- this . vizFn ( {
147
- width : this . width ,
148
- height : this . height ,
149
- data : this . data ,
150
- el : this . el ,
151
- } ) ;
152
- }
153
134
}
135
+ // redraw: function() {
136
+ // this._chooseDataSource();
137
+ // this.data = this.transform(this.data);
138
+ //
139
+ // this._measure();
140
+ //
141
+ // if (this.vizFn) {
142
+ // this.vizFn({
143
+ // width: this.width,
144
+ // height: this.height,
145
+ // data: this.data,
146
+ // el: this.el,
147
+ // });
148
+ // }
149
+ // }
154
150
} ) ;
155
151
156
152
/**
You can’t perform that action at this time.
0 commit comments