Subversion Repositories SmartDukaan

Rev

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

Rev 4786 Rev 4798
Line 302... Line 302...
302
		    load_history_widget();
302
		    load_history_widget();
303
	    }
303
	    }
304
	});
304
	});
305
}
305
}
306
 
306
 
307
function load_research_items(){
-
 
308
	jQuery.ajax({
-
 
309
		type: "GET",
-
 
310
		url: "/myresearch",
-
 
311
		cache: false,
-
 
312
		success: function(json) {
-
 
313
		    $.Storage.set("resitems", json);
-
 
314
		    load_research_widget();
-
 
315
	    }
-
 
316
	});
-
 
317
}
-
 
318
 
-
 
319
function load_research_widget(){
-
 
320
	var myResearchWidgetContainer = $("#myresearch");
-
 
321
	if($(myResearchWidgetContainer).length == 0) {
-
 
322
		return;
-
 
323
	}
-
 
324
	var resitems = $.Storage.get("resitems");
-
 
325
	if (resitems == "[]") {
-
 
326
		var emptyResWidgetHtml = '<table border="0" width="100%" cellspacing="1" cellpadding="0" id="research_default">\
-
 
327
	      <tbody>\
-
 
328
	        <tr>\
-
 
329
	          <td align="center"><b>Add items to compare list</b></td>\
-
 
330
	         </tr>\
-
 
331
	       </tbody>\
-
 
332
	      </table>';
-
 
333
		$(myResearchWidgetContainer).find(".common-widget-content-area").html(emptyResWidgetHtml);
-
 
334
		$(myResearchWidgetContainer).children(".common-widget-top-bar").trigger('click');
-
 
335
		return;
-
 
336
	}
-
 
337
	var params = "/" + resitems;
-
 
338
	
-
 
339
	jQuery.ajax({
-
 
340
		type : "GET",
-
 
341
		url : "/myresearch" + params,
-
 
342
		cache: true,
-
 
343
		success : function(html) {
-
 
344
   		    $("#myresearch").html(html);
-
 
345
 
-
 
346
		    // Product Title
-
 
347
		    $("#myresearch table td div a.truncate").each(function() {
-
 
348
					$(this).truncate({addtitle : true});
-
 
349
		    });
-
 
350
 
-
 
351
		    // Product Price
-
 
352
		    $("#myresearch table td div div.price").each(function() {
-
 
353
					$(this).truncate({addtitle : true});
-
 
354
			});
-
 
355
 
-
 
356
		    // Product Details
-
 
357
		    $("#myresearch table td div div.text").each(function() {
-
 
358
					$(this).truncate( {addtitle : true});
-
 
359
			});
-
 
360
	    }
-
 
361
	});
-
 
362
}
-
 
363
 
-
 
364
function load_history_widget() {
307
function load_history_widget() {
365
	
308
	
366
	var browseHistoryWidgetContainer = $("#browsehistory");
309
	var browseHistoryWidgetContainer = $("#browsehistory");
367
	
310
	
368
	if($(browseHistoryWidgetContainer).length == 0) {
311
	if($(browseHistoryWidgetContainer).length == 0) {