this.elts('list-group-item').click({'instance': this}, this._on_click);
this.prev_filter_status = null;
+
+ /* Initialize tooltips */
+ $("[rel='tooltip']").tooltip();
+
},
/**************************************************************************
// These functions are here to react on external filters, which we don't
// use at the moment
- on_filter_added: function(filter) {
+ on_filter_added: function(filter)
+ {
// XXX
},
- on_filter_removed: function(filter) {
+ on_filter_removed: function(filter)
+ {
// XXX
},
+ on_field_state_changed: function(data)
+ {
+ var query_ext;
+
+ switch (data.state) {
+ case STATE_SET:
+ case STATE_WARNINGS:
+ /* Get the number of pending / unconfigured resources */
+ /* Let's store it in query_ext */
+ query_ext = manifold.query_store.find_analyzed_query_ext(this.options.query_uuid);
+
+ $('#badge-pending').text(query_ext.num_pending);
+ if (query_ext.num_pending > 0) {
+ $('#badge-pending').show();
+ } else {
+ $('#badge-pending').hide();
+ }
+
+ $('#badge-unconfigured').text(query_ext.num_unconfigured);
+ if (query_ext.num_unconfigured > 0) {
+ $('#badge-unconfigured').show();
+ } else {
+ $('#badge-unconfigured').hide();
+ }
+ default:
+ break;
+ }
+ },
+
/**************************************************************************
* PRIVATE METHODS *
**************************************************************************/
// ... and communicate the appropriate filters to the manager
// NOTE: we use the manifold namespace for internal filters
- if (self.prev_filter_status)
- manifold.raise_event(self.options.query_uuid, FILTER_REMOVED, self.prev_filter_status);
-
+ if (self.prev_filter_status) {
+ var filter = ['manifold:status', '==', self.prev_filter_status];
+ manifold.raise_event(self.options.query_uuid, FILTER_REMOVED, filter);
+ }
// XXX The datatables will be refreshed twice !
if (filter_status != 'all') {
// No filter for 'all'