Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ let types = ['all', 'radial', 'linear'];

function es6concat(type = 'all', clean = false) {
let bundle = [
'lib/polyfill.js',
'lib/vendorize.js',
'lib/EventEmitter.js',
'lib/Animation.js',
Expand Down
1 change: 0 additions & 1 deletion lib/BaseGauge.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
require('./polyfill');

const SmartCanvas = require('./SmartCanvas');
const Animation = require('./Animation');
Expand Down
1 change: 0 additions & 1 deletion lib/LinearGauge.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
require('./polyfill');

const BaseGauge = require('./BaseGauge');
const GenericOptions = require('./GenericOptions');
Expand Down
1 change: 0 additions & 1 deletion lib/RadialGauge.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
require('./polyfill');

const GenericOptions = require('./GenericOptions');
const BaseGauge = require('./BaseGauge');
Expand Down
131 changes: 0 additions & 131 deletions lib/polyfill.js

This file was deleted.

26 changes: 16 additions & 10 deletions lib/vendorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
* @param {HTMLElement|Window|object} [from] - default is window
* @returns {*}
*/

let vendor = null;

export default function vendorize(prop, from) {
/* istanbul ignore else: no reason to cover */
if (!from) {
Expand All @@ -49,19 +52,22 @@ export default function vendorize(prop, from) {
return from[prop];
}

let vendors = ['webkit', 'moz', 'ms', 'o'];
let i = 0;
let s = vendors.length;
if (vendor === null) {
let styles = window.getComputedStyle(document.documentElement, '');
vendor = (Array.prototype.slice.call(styles).join('').match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']) || ['', ''])[1];
}

if (vendor === '')
return null;

let capitalized = prop.charAt(0).toUpperCase() + prop.substr(1);

for (; i < s; i++) {
let vendorProp = from[vendors[i] + capitalized];
let vendorProp = from[vendor + capitalized];

/* istanbul ignore if: requires very complex environment to test (specific browser version) */
if (typeof vendorProp !== 'undefined') {
return vendorProp;
}
}
/* istanbul ignore if: requires very complex environment to test (specific browser version) */
if (typeof vendorProp !== 'undefined') {
return vendorProp;
}

return null;
}
Expand Down