fgnass / spin.js

A spinning activity indicator
http://spin.js.org
MIT License
9.3k stars 1.02k forks source link

[request] npm update package to latest stable #306

Closed izdi closed 8 years ago

izdi commented 8 years ago

Could you please upload latest stable package to npm. There is a version which does not add top and left attributes to the spinner className option.

fgnass commented 8 years ago

The latest stable version is 2.3.2. The source of that version can be found here: https://github.com/fgnass/spin.js/blob/2.3.2/spin.js – Could you elaborate what you mean by "does not add top and left attributes to the spinner className option"?

izdi commented 8 years ago

Sorry, first of all I meant about updating package in npm repository;

$ npm install spin
npm http GET https://registry.npmjs.org/spin
npm http 200 https://registry.npmjs.org/spin
spin@0.0.1 node_modules/spin

$ head -1 node_modules/spin/spin.js 
//fgnass.github.com/spin.js#v1.2.5

The npm's package version for some reason is not adding top and left attributes specified in options, i.e (version of spin is 1.2.5)

spinnerOptions: {
        lines: 15, // The number of lines to draw
        length: 11, // The length of each line
        width: 4, // The line thickness
        radius: 9, // The radius of the inner circle
        corners: 1, // Corner roundness (0..1)
        rotate: 0, // The rotation offset
        direction: 1, // 1: clockwise, -1: counterclockwise
        color: '#606060', // #rgb or #rrggbb or array of colors
        speed: 1, // Rounds per second
        trail: 60, // Afterglow percentage
        shadow: false, // Whether to render a shadow
        hwaccel: false, // Whether to use hardware acceleration
        className: 'spinner', // The CSS class to assign to the spinner
        zIndex: 2e9, // The z-index (defaults to 2000000000)
        top: '50%', // Top position relative to parent
        left: '50%' // Left position relative to parent
    },

spinner = new Spinner(this.spinnerOptions).spin(target);
target.appendChild(spinner.el);

After rendering the spinner class spinner does not have style attributes top and left, which leads to wrong position of the spiner block

fgnass commented 8 years ago

Oh alright, you're looking at the wrong package. It's spin.js not spin.

donfusilli commented 7 years ago

@izdi cheers, I had the same confusion - pretty misleading