@@ -23,27 +23,27 @@ $(document).ready(function() {
23
23
24
24
//Make all checkboxes display under eachother.
25
25
setMaxWidth ( getMaxWidth ( ) ) ;
26
-
26
+
27
27
//-------------------------------
28
-
28
+
29
29
var setDisabledColor = function ( ) {
30
- //Get all checkboxes
31
- var boxes = $ ( 'input:checkbox' ) ;
32
-
33
-
34
- $ . each ( boxes , function ( indexInArray , valueOfElement ) {
35
- //If a checkbox is disabled, set the background to a color to show it.
36
- //I could have added or removed a CSS class, but I'm doing that later in the file and right now I also want to use this method.
37
- if ( $ ( boxes [ indexInArray ] ) . attr ( 'disabled' ) ) {
38
- $ ( boxes [ indexInArray ] ) . parent ( ) . css ( { 'background-color' : 'red' } ) ;
39
- } else {
40
- //Else, remove colored background
41
- $ ( boxes [ indexInArray ] ) . parent ( ) . css ( { 'background-color' : 'white' } ) ;
42
- }
43
- } ) ;
44
-
45
- }
46
-
30
+ //Get all checkboxes
31
+ var boxes = $ ( 'input:checkbox' ) ;
32
+
33
+
34
+ $ . each ( boxes , function ( indexInArray , valueOfElement ) {
35
+ //If a checkbox is disabled, set the background to a color to show it.
36
+ //I could have added or removed a CSS class, but I'm doing that later in the file and right now I also want to use this method.
37
+ if ( $ ( boxes [ indexInArray ] ) . attr ( 'disabled' ) ) {
38
+ $ ( boxes [ indexInArray ] ) . parent ( ) . css ( { 'background-color' : 'red' } ) ;
39
+ } else {
40
+ //Else, remove colored background
41
+ $ ( boxes [ indexInArray ] ) . parent ( ) . css ( { 'background-color' : 'white' } ) ;
42
+ }
43
+ } ) ;
44
+
45
+ } ;
46
+
47
47
/**
48
48
* End view section
49
49
*/
@@ -52,7 +52,7 @@ $(document).ready(function() {
52
52
/**
53
53
* Start logic section
54
54
*/
55
-
55
+
56
56
//Upon checking or unchecking a checkbox, hide or display all items not related to it.
57
57
$ ( 'input:checkbox' ) . on ( 'change' , function ( ) {
58
58
//First thing to do on every change: go over all checkboxes.
@@ -87,7 +87,7 @@ $(document).ready(function() {
87
87
allPresent = false ;
88
88
}
89
89
} ) ;
90
-
90
+
91
91
//If an item has the attributes of all checked checkboxes, remove hidden.
92
92
//If even 1 is missing, set hidden
93
93
if ( ! allPresent ) {
@@ -106,8 +106,8 @@ $(document).ready(function() {
106
106
107
107
$ . each ( visibleItems , function ( ) {
108
108
var classes = $ ( this ) . children ( 'img' ) . attr ( 'class' ) . split ( ' ' ) ;
109
-
110
- if ( classes . indexOf ( pureHtml . value ) !== - 1 ) {
109
+
110
+ if ( classes . indexOf ( pureHtml . value ) !== - 1 ) {
111
111
comboPossible = true ;
112
112
}
113
113
} ) ;
@@ -120,12 +120,31 @@ $(document).ready(function() {
120
120
} ) ;
121
121
122
122
}
123
-
123
+
124
124
//And set the backgroundcolor for the disabled checkboxes
125
125
setDisabledColor ( ) ;
126
126
} ) ;
127
-
128
-
127
+
128
+
129
+ $ ( "figure" ) . on ( 'click' , function ( eventObject ) {
130
+ var currentItem = getItemInfo ( this . id ) ;
131
+
132
+ } ) ;
133
+
134
+ var getItemInfo = function ( itemName ) {
135
+ var jqxhr = $ . ajax ( {
136
+ url : "http://localhost/Dota2ItemFilter/ajax.php" ,
137
+ type : "POST" ,
138
+ data : { name : itemName } ,
139
+ dataType : "json" ,
140
+ } ) . fail ( function ( ) { alert ( "error" ) ; } ) ;
141
+
142
+ jqxhr . done ( function ( data ) {
143
+ console . log ( data ) ;
144
+ } ) ;
145
+ } ;
146
+
147
+
129
148
/**
130
149
* End logic section
131
150
*/
0 commit comments