Code coverage report for lib/FilterDialog.js

Statements: 28.57% (6 / 21)      Branches: 100% (0 / 0)      Functions: 20% (1 / 5)      Lines: 28.57% (6 / 21)      Ignored: none     

All files » lib/ » FilterDialog.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48          1 1   1 1                                                       1                   1
/*jslint node: true */
/*jshint laxbreak: true */
/*jshint laxcomma: true */
"use strict";
 
var d3 = require("d3");
var _ = require("underscore");
 
var FilterDialog = function() {
    var populateDialog = function(self, fv) {
        var divManual = self.dialog.append('div');
        divManual.append('input')
            .attr('type', 'checkbox')
            .attr('id', 'up_pftv_dialog-checkReviewed')
            .property('checked', true)
            .on('click', function() {
                var checkReviewed = d3.select('#up_pftv_dialog-checkReviewed').property('checked');
                var checkOther = d3.select('#up_pftv_dialog-checkOther').property('checked');
                fv.applyFilter(checkReviewed, checkOther);
            });
        divManual.append('label')
            .text('Manually reviewed');
 
        var divOther = self.dialog.append('div');
        divOther.append('input')
            .attr('type', 'checkbox')
            .attr('id', 'up_pftv_dialog-checkOther')
            .property('checked', true)
            .on('click', function() {
                var checkReviewed = d3.select('#up_pftv_dialog-checkReviewed').property('checked');
                var checkOther = d3.select('#up_pftv_dialog-checkOther').property('checked');
                fv.applyFilter(checkReviewed, checkOther);
            });
        divOther.append('label')
            .text('Large scale studies');
    };
 
    return {
        displayDialog: function(container, fv) {
            this.dialog = container.append('div')
                .attr('class','up_pftv_dialog-container');
            populateDialog(this, fv);
            return this.dialog;
        }
    };
}();
 
module.exports = FilterDialog;