pryley / float-labels.js

A zero-dependency plugin that applies the float label pattern to a form.
https://pryley.github.io/float-labels.js/
MIT License
88 stars 22 forks source link

Module Support #21

Closed schellenbergk closed 6 years ago

schellenbergk commented 6 years ago

Hey, Great Plugin, however, would be nice if you added module support... Should not be much work. It would be nice to just:

import FloatLabels from 'float-labels.js';

I think all you have to do is duplicate float-labels.js/src/float-labels.js -> float-labels.js/src/float-labels-module.js and remove:

;(function( window, document, undefined )
{
    "use strict";
//and
})( window, document );

and replace:

window.FloatLabels = Plugin;

with

export default Plugin;

Thanks!

pryley commented 6 years ago

see v3.3.3 8d04e05