Subversion-Projekte lars-tiefland.faltradxxs.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
$(document).ready(function(){
2
 
3
     $('.options').delegate("#modellForm1 select", "change", function(){
4
        //Ist gesetzt wenn man sich im Artikelstamm befindet
5
        if( $("input[name='refreshFilter']").val() == true ){
6
            refreshFilter("select");
7
        }else{
8
            showResult("result");
9
            showResult("basket");
10
            showResult("bild");
11
            showResult("beschreibungReload");
12
        }
13
     });
14
     $('.options').change(function(){
15
        refreshFilter("select");
16
     });
17
     $('.options').delegate( '#modellForm1 #resetForm', "click", function(){
18
        refreshFilter("reset");
19
     });
20
 
21
     $('.subdir_sort').delegate("#modellForm1 select, #modellForm1 input", "change", function(){
22
        var aid = $(this).find('option:selected').text();
23
        $("#loading").dialog("open");
24
        refreshSubdirFilterFilter("select",aid);
25
        showSubdirFilterResult("result");
26
        setTimeout(function () {
27
            $('#loading').dialog('close');
28
         }, 100);
29
     });
30
     $('.subdir_sort').delegate( '#modellForm1 .resetbutton', "click", function(e){
31
        location.reload();
32
     });
33
 
34
 
35
 
36
     function showSubdirFilterResult(mode)
37
     {
38
        daten=$('#modellForm1').serializeArray();
39
        $.ajax({
40
            type: "POST",
41
            url : "/module/filter_auspraegungen.php?mode="+mode,
42
            data: daten,
43
            async: false,
44
            success: function(html){
45
 
46
                if(mode == "result"){
47
                    $(".pagination_container").css("display", "none");
48
 
49
                    $('.subdir_artikel').html(html);
50
                    $(".subdir_artikel").css("background-color", "transparent" );
51
                    $(".loader").hide();
52
                    $(".pagination_seite").css("display", "none");
53
                     $(".pagination_artikel").css("display", "none");
54
                    $(".newsorting").css("display", "block");
55
 
56
                }
57
            }
58
        })
59
     }
60
 
61
     function refreshSubdirFilterFilter(mode,aid){
62
 
63
        daten=$('#modellForm1').serializeArray();
64
        $.ajax({
65
            type: "POST",
66
            url : "/module/updateSearchFilterSubdir.php?mode="+mode + "&aid=" + aid,
67
            data: daten,
68
            async: false,
69
            beforeSend: function(){
70
                $(".box_2").css("background-color", "transparent" );
71
                $(".subdir_artikel").css("background-color", "#ccc" );
72
                $(".loader").show();
73
            },
74
            success: function(html){
75
                $('.optionsReload').html(html);
76
            }
77
        })
78
        return true;
79
     }
80
 
81
     function showResult(mode)
82
     {
83
        var daten=$('#modellForm1').serializeArray();
84
 
85
        $.ajax({
86
            type: "POST",
87
            url : "/module/filter_auspraegungen.php?mode="+mode,
88
            data: daten
89
        }).done(function(html){
90
            if(mode == "result"){
91
                $('.subdir_artikel').html(html);
92
            }else if(mode == "bild"){
93
                $('.itemLeftContainer').html(html);
94
                initElevateZoom("inner");
95
            }else if(mode == "beschreibungReload"){
96
                $('.reiterTabs').html(html);
97
            }else{
98
                $('.basketReload').html(html);
99
            }
100
        })
101
     }
102
 
103
     function refreshFilter(mode){
104
 
105
        var daten=$('#modellForm1').serializeArray();
106
        if(daten.length>0) {
107
            $.ajax({
108
                type: "POST",
109
                url : "/module/updateSearchFilterSubdir.php?mode="+mode,
110
                data: daten
111
            }).done(function(html){
112
                $('.optionsReload').html(html);
113
 
114
                showResult("beschreibungReload");
115
                showResult("result");
116
                showResult("basket");
117
                showResult("bild");
118
 
119
            });
120
        }
121
     }
122
 
123
 
124
});