bufferapp/diggdigg — pull request #18 by DaveBurns (2013-04-20 15:57:56+00:00)
Title: More flexibility over position of floating bar

This pull request has small changes that allow a plugin user to better control vertical positioning of the floating bar. The custom positioning can be set per page. This functionality has been requested several times in the plugin's support forum on Wordpress.org.

In the interest of making minimal code changes, it does this by using the existing Custom Fields interface of WordPress:

If the user creates a custom field named "dd_override_start_anchor_id" and gives it a value of a DOM id on the page, the floating bar will align itself vertically to that DOM element instead of the default "dd_start" (which itself is aligned to the top of the post content area). Note that the name of the DOM element should NOT include the '#' prefix.

In addition, the user can create a custom field named "dd_override_top_offset" and give it an integer value in pixels. Positive values move the floating bar downward from the DOM element it is anchored to, negative values move it upward. Note that the value should NOT include a "px" suffix although the code uses parseInt() so it should be resilient to this.

One can choose to use one or both of these custom fields at the same time.