css/static/js/scheduling.js
//     - Only set to inactive if another is selected
Only set to inactive if another is selected
Only set to inactive if another is selected
function selectFilter(element, filterType) {
    if (element.value == "inactive") {
        element.value = "active";
        element.className = "noselect filter-type-active";
        for (var i = 0; i < filters.length; ++i) {
            var btnName = filters[i] + "-filter-btn";
            if (element.id != btnName) {
                $("#"+btnName)[0].value = "inactive" 
                $("#"+btnName)[0].className = "noselect filter-type"; 
            }
       }
        $.ajax({
            type: "GET",
            url: "options",
            data: {type: element.innerHTML},
            success: function(response) {
                data = JSON.parse(response)
                var optionFormatString =
                    "<div id=\"option-{0}\" class=\"input-group\">\n" +
                    "  <span class=\"input-group-addon\">\n" +
                    "    <input id=\"option-checkbox\" type=\"checkbox\" onclick=\"selectOption(this)\">\n" +
                    "  </span>\n" +
                    "  <p class=\"form-control\">{0}</p>\n" +
                    "</div>\n";
                optionFrame = $("#option-frame");
                optionFrame.empty();
                for (var i in data.options) {
                    optionFrame.append(optionFormatString.format(data.options[i].name));
                    $("#"+filterType).children("div").each(function(index, value) {
                        if (value.id == data.options[i].name) {
                            $("#option-"+data.options[i].name).children("span").children("input").prop("checked", true);
                        }
                    });
                }
            },
            error: function(err) {
                console.log('error: ' + err)
            }
        });
    }
}
function selectFilter ( element , filterType ) { if ( element . value == "inactive" ) { element . value = "active" ; element . className = "noselect filter-type-active" ; for ( var i = 0 ; i < filters . length ; ++ i ) { var btnName = filters [ i ] + "-filter-btn" ; if ( element . id != btnName ) { $ ( "#" + btnName ) [ 0 ] . value = "inactive" $ ( "#" + btnName ) [ 0 ] . className = "noselect filter-type" ; } } $ . ajax ( { type : "GET" , url : "options" , data : { type : element . innerHTML } , success : function ( response ) { data = JSON . parse ( response ) var optionFormatString = "<div id=\"option-{0}\" class=\"input-group\">\n" + "  <span class=\"input-group-addon\">\n" + "    <input id=\"option-checkbox\" type=\"checkbox\" onclick=\"selectOption(this)\">\n" + "  </span>\n" + "  <p class=\"form-control\">{0}</p>\n" + "</div>\n" ; optionFrame = $ ( "#option-frame" ) ; optionFrame . empty ( ) ; for ( var i in data . options ) { optionFrame . append ( optionFormatString . format ( data . options [ i ] . name ) ) ; $ ( "#" + filterType ) . children ( "div" ) . each ( function ( index , value ) { if ( value . id == data . options [ i ] . name ) { $ ( "#option-" + data . options [ i ] . name ) . children ( "span" ) . children ( "input" ) . prop ( "checked" , true ) ; } } ) ; } } , error : function ( err ) { console . log ( 'error: ' + err ) } } ) ; } }
Only set to inactive if another is selected
Only set to inactive if another is selected
// Unselect other filter types // Get options for this filter type // Add to option window  // Check if already in selected