Subversion Repositories SmartDukaan

Rev

Rev 2755 | Rev 2762 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2755 Rev 2759
Line 178... Line 178...
178
          jQuery.ajax({
178
          jQuery.ajax({
179
               type: "POST",
179
               type: "POST",
180
                      url: "/addtoresearch",
180
                      url: "/addtoresearch",
181
                      data: "productid=[" + seldata +  "]",
181
                      data: "productid=[" + seldata +  "]",
182
                      success: function(msg){
182
                      success: function(msg){
-
 
183
                           var postSuccessDOMProcessing = function(objValue)	{
-
 
184
                        	   trackEventWithGA('Research', 'Add to Research', objValue);
-
 
185
                        	   add_to_storage_set("resitems", objValue);
-
 
186
                        	   var tblid = "#pane1 #" + objValue + " td";
-
 
187
                        	   $(tblid + " div a.truncate").truncate({addtitle: true});
-
 
188
                        	   $(tblid + " div div.price").truncate({addtitle: true});
-
 
189
                        	   $(tblid + " div div.text").truncate({addtitle: true});
-
 
190
                        	   $(tblid).animate({ backgroundColor: "#fcffb3" }, 'slow');
-
 
191
                        	   $(tblid).animate({ backgroundColor: "#F5F5F5" }, 'slow');
-
 
192
                           };
183
                           
193
                           
184
                           if(msg == 0){
194
                           if(msg == 0){
185
                                alert( "Product is already in my research" );
195
                                alert( "Product is already in my research" );
186
                           }else {
196
                           } else	{
187
                                var t = (research_tot * 1) + (tot * 1);
197
                                var t = (research_tot * 1) + (tot * 1);
188
                                $("#research_total").val(t);
198
                                $("#research_total").val(t);
189
                                if(t > 0){
199
                                if(t > 0)	{
190
                                     $("#research_default").css("display","none");
200
                                     $("#research_default").css("display","none");
191
                                }     
201
                                }     
192
                                $("#pane1").prepend(msg);
202
                                $("#pane1").prepend(msg);
193
                                
203
                                
194
                                if(reqtype == "multi"){
204
                                if(reqtype == "multi")	{
195
                                     jQuery.each(seldata,function(intIndex, objValue){
205
                                     jQuery.each(seldata,function(intIndex, objValue)	{
196
                                    	 trackEventWithGA('Research', 'Add to Research', objValue);
-
 
197
                                    	  add_to_storage_set("resitems", objValue);
206
                                    	 postSuccessDOMProcessing(objValue);
198
                                    	  var tblid="#pane1 #"+objValue+ " td";
-
 
199
                                          $(tblid + " div a.truncate").truncate({addtitle: true});
-
 
200
                                          $(tblid + " div div.price").truncate({addtitle: true});
-
 
201
                                          $(tblid + " div div.text").truncate({addtitle: true});
-
 
202
                                          $(tblid).animate({ backgroundColor: "#fcffb3" }, 'slow');
-
 
203
                                          $(tblid).animate({ backgroundColor: "#F5F5F5" }, 'slow');
-
 
204
                                     });
207
                                     });
205
                                     
208
                                     
206
                                }else if(reqtype == "single"){
209
                                } else if(reqtype == "single")	{
207
                                	 add_to_storage_set("resitems", seldata);
210
                                	postSuccessDOMProcessing(seldata);
208
                                     trackEventWithGA('Research', 'Add to Research', seldata + "");
-
 
209
                                     var tblid="#pane1 #"+seldata+ " td";
-
 
210
                                     $(tblid + " div a").truncate({addtitle: true});
-
 
211
                                     $(tblid + " div div.price").truncate({addtitle: true});
-
 
212
                                     $(tblid + " div div.text").truncate({addtitle: true});
-
 
213
                                     $(tblid).animate({ backgroundColor: "#fcffb3" }, 'slow');
-
 
214
                                     $(tblid).animate({ backgroundColor: "#F5F5F5" }, 'slow');  
-
 
215
                                }else if(reqtype == "list"){
-
 
216
 
-
 
217
                                    trackEventWithGA('Research', 'Add to Research', seldata + "");
-
 
218
                                    
211
                                	
219
                                	 add_to_storage_set("resitems", seldata);
212
                                } else if(reqtype == "list")	{
220
                                     var tblid="#pane1 #"+seldata+ " td";
213
                                	postSuccessDOMProcessing(seldata);
221
                                     $(tblid + " div a").truncate({addtitle: true});
-
 
222
                                     $(tblid + " div div.price").truncate({addtitle: true});
-
 
223
                                     $(tblid + " div div.text").truncate({addtitle: true});
-
 
224
                                     $(tblid).animate({ backgroundColor: "#fcffb3" }, 'slow');
-
 
225
                                     $(tblid).animate({ backgroundColor: "#F5F5F5" }, 'slow');     
-
 
226
                                }    
214
                                }
227
                           }
215
                           }
228
                      }
216
                      }
229
          });
217
          });
230
          
-
 
231
     }else{
218
     } else	{
232
          alert("Please select atleast one product");
219
          alert("Please select atleast one product");
233
     }
220
     }
234
}
221
}
235
 
222
 
236
 
223