Subversion Repositories SmartDukaan

Rev

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

Rev 28051 Rev 28055
Line 613... Line 613...
613
				function(index, checkbox) {
613
				function(index, checkbox) {
614
					checkbox.checked = coloredItems[index].active;
614
					checkbox.checked = coloredItems[index].active;
615
				});
615
				});
616
		});
616
		});
617
}
617
}
-
 
618
 
-
 
619
 
-
 
620
function getHotdealsForItems(catalogId, itemId, description, callback) {
-
 
621
	bootBoxObj = {
-
 
622
		size: "small",
-
 
623
		className: "item-wrapper",
-
 
624
		title: description,
-
 
625
		callback: callback,
-
 
626
		inputType: 'checkbox',
-
 
627
	}
-
 
628
	doGetAjaxRequestHandler(context + "/hotdealsitemsByCatalogId?catalogId="
-
 
629
		+ catalogId + "&itemId=" + itemId, function(response) {
-
 
630
			coloredItems = JSON.parse(response);
-
 
631
			inputOptions = [{
-
 
632
				text: "All",
-
 
633
				value: "0",
-
 
634
				onclick: "toggleAll('itemIds')"
-
 
635
			}];
-
 
636
			coloredItems.forEach(function(item) {
-
 
637
				inputOptions.push({
-
 
638
					text: item.color,
-
 
639
					value: item.id,
-
 
640
					selected: item.hotDeals
-
 
641
				});
-
 
642
			});
-
 
643
			bootBoxObj['inputOptions'] = inputOptions;
-
 
644
			promptObj = bootbox.prompt(bootBoxObj);
-
 
645
			promptObj.modal('show')
-
 
646
			$('.item-wrapper').find("input[type='checkbox']").slice(1).each(
-
 
647
				function(index, checkbox) {
-
 
648
					checkbox.checked = coloredItems[index].hotDeals;
-
 
649
				});
-
 
650
		});
-
 
651
}
618
$(document).on('change', ".item-wrapper input[type='checkbox']:first",
652
$(document).on('change', ".item-wrapper input[type='checkbox']:first",
619
	function() {
653
	function() {
620
		if (this.value == "0") {
654
		if (this.value == "0") {
621
			$(this).closest('.item-wrapper').find("input[type='checkbox']")
655
			$(this).closest('.item-wrapper').find("input[type='checkbox']")
622
				.slice(1).prop('checked', $(this).prop('checked'));
656
				.slice(1).prop('checked', $(this).prop('checked'));
Line 715... Line 749...
715
	if (messageType == null) {
749
	if (messageType == null) {
716
		messageQueryString = "";
750
		messageQueryString = "";
717
	}
751
	}
718
	doGetAjaxRequestHandler(context + "/notifications" + messageQueryString, function(response) {
752
	doGetAjaxRequestHandler(context + "/notifications" + messageQueryString, function(response) {
719
		if ($container != null) {
753
		if ($container != null) {
720
			loaderDialogObj.one('hidden.bs.modal', function(){
754
			loaderDialogObj.one('hidden.bs.modal', function() {
721
				$container.popover({
755
				$container.popover({
722
					container: $container,
756
					container: $container,
723
					template: '<div class="popover popover1" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content popover2"></div></div>',
757
					template: '<div class="popover popover1" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content popover2"></div></div>',
724
					content: response,
758
					content: response,
725
					html: true,
759
					html: true,
Line 742... Line 776...
742
		documentName);
776
		documentName);
743
}
777
}
744
 
778
 
745
 
779
 
746
/* Create an array with the values of all the input boxes in a column */
780
/* Create an array with the values of all the input boxes in a column */
747
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
781
$.fn.dataTable.ext.order['dom-text'] = function(settings, col) {
748
{
-
 
749
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
782
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
750
        return $('input', td).val();
783
		return $('input', td).val();
751
    } );
784
	});
752
}
785
}
753
 
786
 
754
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
787
	/* Create an array with the values of all the input boxes in a column, parsed as numbers * /
755
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
788
$.fn.dataTable.ext.order['dom-text-numeric'] = function(settings, col) {
756
{
-
 
757
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
789
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
758
        return $('input', td).val() * 1;
790
		return $('input', td).val() * 1;
759
    } );
791
	});
760
}
792
}
761
 
793
 
762
/* Create an array with the values of all the select options in a column */
794
/* Create an array with the values of all the select options in a column */
763
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
795
$.fn.dataTable.ext.order['dom-select'] = function(settings, col) {
764
{
-
 
765
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
796
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
766
        return $('select', td).val();
797
		return $('select', td).val();
767
    } );
798
	});
768
}
799
}
769
 
800
 
770
/* Create an array with the values of all the checkboxes in a column */
801
/* Create an array with the values of all the checkboxes in a column */
771
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
802
$.fn.dataTable.ext.order['dom-checkbox'] = function(settings, col) {
772
{
-
 
773
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
803
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
774
        return $('input', td).prop('checked') ? '1' : '0';
804
		return $('input', td).prop('checked') ? '1' : '0';
775
    } );
805
	});
776
}
806
}
777
807