Subversion Repositories SmartDukaan

Rev

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

Rev 26744 Rev 27754
Line 1... Line 1...
1
$(".web-listing").live('click', function() {
1
$(document).on('click', ".web-listing", function() {
2
	loadWebListing("main-content");
2
	loadWebListing("main-content");
3
});
3
});
4
$("a.listing-details").live('click', function() {
4
$(document).on('click', "a.listing-details", function() {
5
	var webListingId = $(this).data("id");
5
	var webListingId = $(this).data("id");
6
	doAjaxRequestHandler(`${context}/web-listing/${webListingId}`, "GET", function(response) {
6
	doAjaxRequestHandler(`${context}/web-listing/${webListingId}`, "GET", function(response) {
7
		$('.web-products-container').html(response);
7
		$('.web-products-container').html(response);
8
	});
8
	});
9
	
9
	
10
})
10
})
11
 
11
 
12
$("#update-rank").live('click', function(){
12
$(document).on('click', "#update-rank", function(){
13
	if(confirm("Are you sure you want to update ranks?")) {
13
	if(confirm("Are you sure you want to update ranks?")) {
14
		var webListingId=$(this).data("id");
14
		var webListingId=$(this).data("id");
15
		var webProductIds=[];
15
		var webProductIds=[];
16
		$("#web-product-listing-tbody").find("tr").each(function(){
16
		$("#web-product-listing-tbody").find("tr").each(function(){
17
			console.log(this);
17
			console.log(this);
Line 20... Line 20...
20
		doPostAjaxRequestWithJsonHandler(`${context}/web-listing/order/${webListingId}`, JSON.stringify(webProductIds), function(response) {
20
		doPostAjaxRequestWithJsonHandler(`${context}/web-listing/order/${webListingId}`, JSON.stringify(webProductIds), function(response) {
21
			$('.web-products-container').html(response);
21
			$('.web-products-container').html(response);
22
		});
22
		});
23
	}
23
	}
24
});
24
});
25
$("#add-listing").live('click', function() {
25
$(document).on('click', "#add-listing", function() {
26
	var webListingId=$(this).data("id");
26
	var webListingId=$(this).data("id");
27
	var entityIds = [entityId];
27
	var entityIds = [entityId];
28
 
28
 
29
	var entityIdTxt=$("#entityData").val();
29
	var entityIdTxt=$("#entityData").val();
30
	if(entityIdTxt.length > 0) {
30
	if(entityIdTxt.length > 0) {
Line 60... Line 60...
60
		$('#main-content').html(response);
60
		$('#main-content').html(response);
61
	});
61
	});
62
}
62
}
63
 
63
 
64
 
64
 
65
$(".grab").live('mousedown', function (e) {
65
$(document).on('mousedown', ".grab", function (e) {
66
    var tr = $(e.target).closest("TR"), si = tr.index(), sy = e.pageY, b = $(document.body), drag;
66
    var tr = $(e.target).closest("TR"), si = tr.index(), sy = e.pageY, b = $(document.body), drag;
67
    b.addClass("grabCursor").css("userSelect", "none");
67
    b.addClass("grabCursor").css("userSelect", "none");
68
    tr.addClass("grabbed");
68
    tr.addClass("grabbed");
69
    function move (e) {
69
    function move (e) {
70
    	console.log(Math.abs(e.pageY - sy));
70
    	console.log(Math.abs(e.pageY - sy));