Subversion Repositories SmartDukaan

Rev

Rev 37458 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37458 Rev 37564
Line 910... Line 910...
910
            $(this).closest('.item-wrapper').find("input[type='checkbox']")
910
            $(this).closest('.item-wrapper').find("input[type='checkbox']")
911
                .slice(1).prop('checked', $(this).prop('checked'));
911
                .slice(1).prop('checked', $(this).prop('checked'));
912
        }
912
        }
913
    });
913
    });
914
 
914
 
-
 
915
// activeOnly is optional and defaults to false, so existing 3-argument callers
-
 
916
// keep the whole-catalogue list. Creation screens pass true to hide delisted SKUs.
915
function getItemAheadOptions(jqElement, anyColor, callback) {
917
function getItemAheadOptions(jqElement, anyColor, callback, activeOnly) {
916
    console.log(anyColor)
918
    console.log(anyColor)
917
    jqElement.typeahead('destroy').typeahead({
919
    jqElement.typeahead('destroy').typeahead({
918
        source: function (q, process) {
920
        source: function (q, process) {
919
            if (q.length >= 3) {
921
            if (q.length >= 3) {
920
                return $.ajax(context + "/item?anyColor=" + anyColor, {
922
                return $.ajax(context + "/item?anyColor=" + anyColor + "&activeOnly=" + (activeOnly === true), {
921
                    global: false,
923
                    global: false,
922
                    data: {
924
                    data: {
923
                        query: q
925
                        query: q
924
                    },
926
                    },
925
                    headers: {
927
                    headers: {