vanderlee/colorpicker — Issue #6: Dialog placement (Allow padding from window edge).
Author: cjboco
Created: 2011-11-03 20:22:26+00:00
State: open

This was something else I added, but forgot to add to my GitHub fork. Add some padding to the dialog to make sure it's not floating directly next to the window edge.

In the "open" function, you had:

x -= Math.max(0, (x + this.dialog.width()) - $(window).width());
y -= Math.max(0, (y + this.dialog.height()) - $(window).height());

... and I changed it to allow a 20 pixel padding. (Maybe this could be a setting the user could override?)

x -= Math.max(0, (x + this.dialog.width()) - $(window).width() + 20);
y -= Math.max(0, (y + this.dialog.height()) - $(window).height() + 20);

Also, I apologize, I'm still trying to figure out how GitHub works andI couldn't figure out how to update my forked branch with your updates or I would have done the updates myself instead of posting here.