davatron5000/FitVids.js — pull request #28 by mkai (2011-12-18 14:05:09+00:00)
Title: Only insert the style element once

I use Ajax/Pjax to load new content dynamically and call ``fitVids()`` on the updated content to apply the ftVids wrapper. This change makes sure that the ``style`` tag doesn't get duplicated every time ``fitVids()`` is called.

The implementation could probably be optimized performance-wise (e. g. by setting a state variable on the element or the document?), but I didn't want to make design decisions.