Update plugin.js

Like classic library, we look if the bottom of the window is not too close. If it is, we set the position above.