Sha256: d684dc2d086aa472a6f56ff2e04e5c1ae4ef8b54b0a8f0b315d2e9e6cb63a383

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

(function() {
  function initEasyPieChartDemo() {

    jQuery('.js-pie-chart:not(.js-pie-chart-enabled)').each(function(){
      var el = jQuery(this);

      // Add .js-pie-chart-enabled class to tag it as activated
      el.addClass('js-pie-chart-enabled');

      // Init
      el.easyPieChart({
        barColor: el.data('bar-color') || '#777777',
        trackColor: el.data('track-color') || '#eeeeee',
        lineWidth: el.data('line-width') || 3,
        size: el.data('size') || '80',
        animate: el.data('animate') || 750,
        scaleColor: el.data('scale-color') || false
      });
    });

    jQuery('.js-pie-randomize').on('click', function(){
            jQuery(this)
                .parents('.block')
                .find('.pie-chart')
                .each(function() {
                    var random = Math.floor((Math.random() * 100) + 1);

                    jQuery(this)
                        .data('easyPieChart')
                        .update(random);
                });
        });
  }

  KisoThemes.hookOnPageLoad( function() {
    KisoThemes.jsLibIsActive('demo-easypiechart') && initEasyPieChartDemo.call(this)
  })

})()

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
kiso_themes-1.0.2 app/assets/javascripts/kiso_themes/demo/easypiechart.js
kiso_themes-1.0.2 lib/generators/kiso_themes/templates/rails6/kiso_themes/demo/easypiechart.js