Sha256: 016e6c690ffdb25e4f4f34c9573ae5c492e21766c8f62da096162215ebcad4af

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

Dasht.scroll_init = function(el, options) {
    var old_value = undefined;
    var num_entries = options["n"] || 10;
    var metric = $(el).find(".metric");
    $(el).on('update', function(event, value) {
        value = value.slice(-1 * num_entries);
        if (_.isEqual(old_value, value)) return;
        metric.animate({ opacity: 0.8 }, 0, function() {
            metric.html(value.join("<br />"));
            metric.animate({ opacity: 1.0 }, 400);
        });
        old_value = value;
    });
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dasht-0.1.0 assets/plugins/scroll.js