Subversion Repositories SmartDukaan

Rev

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

Rev 1043 Rev 1047
Line 1... Line 1...
1
// Ebizon Move script js into the file
1
// Ebizon Move script js into the file
2
 
2
 
3
$(document).ready(function() {
3
$(document).ready(function() {
-
 
4
  $('#addAdrBtn').click(function(){
-
 
5
    $('#newShipAdr').show();			 
-
 
6
    scrollWin();
-
 
7
  });
-
 
8
 
-
 
9
  function scrollWin(){
-
 
10
    $('html, body').animate({
-
 
11
      scrollTop: $("#newShipAdr").offset().top
-
 
12
    }, 2000);
-
 
13
  }
-
 
14
 
4
  $('.category-tabs').click(function() {
15
  $('.category-tabs').click(function() {
5
    var items = this.id;
16
    var items = this.id;
6
    var title = this.title;
17
    var title = this.title;
7
    var url = this.name;
18
    var url = this.name;
8
    var itemsarray = items.split('-');
19
    var itemsarray = items.split('-');
Line 155... Line 166...
155
    var items = this.id;
166
    var items = this.id;
156
    var itemsarray = items.split('-');
167
    var itemsarray = items.split('-');
157
    addResearch(itemsarray[1], itemsarray[0]);
168
    addResearch(itemsarray[1], itemsarray[0]);
158
    return false;
169
    return false;
159
  });
170
  });
-
 
171
  $("#research_delete").click(function(){
-
 
172
    var research_tot=$("#research_total").val();
-
 
173
 
-
 
174
    var seldata="";
-
 
175
    var tot=0;
-
 
176
    var saprt="";
-
 
177
    var containerdiv = "#pane1";
-
 
178
    var par= containerdiv + " input[type=checkbox]:checked";
-
 
179
    $(par).each(function(){
-
 
180
      saprt = (tot>0)? "_":"";
-
 
181
      seldata += saprt+$(this).val();
-
 
182
      tot++
-
 
183
    });
-
 
184
    if(tot>0){
-
 
185
      var t=(research_tot*1)-(tot*1);
-
 
186
      $("#research_total").val(t);
-
 
187
 
-
 
188
      //alert("AJAX request to delete products in research. Product ID: "+seldata+" and total: "+tot);
-
 
189
      jQuery.ajax({
-
 
190
        type: "GET",
-
 
191
        url: "/myresearch/" + seldata + "?_method=delete",
-
 
192
        data: "productid="+seldata,
-
 
193
        success: function(msg){
-
 
194
        //   alert( "Data Saved: " + msg );
-
 
195
        }
-
 
196
      });
-
 
197
      var arrayprod_id=seldata.split("_");
-
 
198
      jQuery.each(arrayprod_id,function(intIndex, objValue){
-
 
199
        var tableref="#"+objValue;
-
 
200
        $(tableref).animate({
-
 
201
          backgroundColor: "#fcffb3"
-
 
202
        }, 'slow');
-
 
203
        $(tableref).animate({
-
 
204
          backgroundColor: "#F5F5F5"
-
 
205
        }, 'slow', function() {
-
 
206
          $(this).fadeOut('slow', function() {
-
 
207
            $(this).remove();
-
 
208
            if(t === 0){
-
 
209
              $("#research_default").css("display","block");
-
 
210
            }
-
 
211
          } )
-
 
212
        });
-
 
213
 
-
 
214
      });
-
 
215
    }else{
-
 
216
      alert("Please select atleast one product");
-
 
217
    }
-
 
218
  });
-
 
219
});
-
 
220
 
160
 
221
 
161
	$("#research_delete").click(function(){
-
 
162
		var research_tot = $("#research_total").val();
-
 
163
		var seldata = "";
-
 
164
		var tot = 0;
-
 
165
		var saprt = "";
-
 
166
		var containerdiv = "#pane1";
-
 
167
		var par = containerdiv + " input[type=checkbox]:checked";
-
 
168
 
-
 
169
		$(par).each(function(){
-
 
170
			saprt = (tot > 0) ? "_" : "";
-
 
171
			seldata += saprt + $(this).val();
-
 
172
			tot ++;
-
 
173
		});
-
 
174
	
-
 
175
		if(tot > 0)	{
-
 
176
			var t = (research_tot * 1) - (tot * 1);
-
 
177
			$("#research_total").val(t);
-
 
178
	
-
 
179
			jQuery.ajax({
-
 
180
				type: "GET",
-
 
181
				url: "/myresearch/" + seldata + "?_method=delete",
-
 
182
				data: "productid=" + seldata,
-
 
183
				success: function(msg){
-
 
184
					jQuery.each(seldata.split("_"), function(intIndex, objValue){
-
 
185
						$("#pane1").find("#" + objValue).fadeOut('slow', function() {
-
 
186
							$(this).remove();
-
 
187
							if(t === 0)	$("#research_default").css("display", "block");
-
 
188
						});
-
 
189
					});
-
 
190
				}
-
 
191
			});
-
 
192
		} else	{
-
 
193
			alert("Please select atleast one product");
-
 
194
		}
-
 
195
	});
-
 
196
});
-
 
197
222