Sha256: 4ec96888eb71730761d4bff974738b36f3adaa2fe6d81c181001af00ae48a105

Contents?: true

Size: 844 Bytes

Versions: 4

Compression:

Stored size: 844 Bytes

Contents

$(function() {
	

	function drawDashboardItemsListSparklines(){
		$(".dashboard-page .items .sparkline").each(function() {
			var type = $(this).data('type');

			// There is predefined data
			if ($(this).data('data')) {
				var data = $(this).data('data').split(',').map(function(item) {
					if (item.indexOf(":") > 0) {
						return item.split(":");
					}
					else {
						return item;
					}
				});
			}
			// Generate random data
			else {
				var data = [];
				for (var i = 0; i < 17; i++) {
					data.push(Math.round(100 * Math.random()));
				}
			}


			$(this).sparkline(data, {
				barColor: config.chart.colorPrimary.toString(),
				height: $(this).height(),
				type: type
			});
		});
	}

	drawDashboardItemsListSparklines();

	$(document).on("themechange", function(){
        drawDashboardItemsListSparklines();
    });
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_modular_admin-0.2.4 app/assets/javascripts/rails_modular_admin/app/dashboard/items/items.js
rails_modular_admin-0.2.3 app/assets/javascripts/rails_modular_admin/app/dashboard/items/items.js
rails_modular_admin-0.2.2 app/assets/javascripts/rails_modular_admin/app/dashboard/items/items.js
rails_modular_admin-0.2.0 app/assets/javascripts/rails_modular_admin/app/dashboard/items/items.js