daviferreira/medium-editor — pull request #282 by Dayjo (2014-08-20 16:07:57+00:00)
Title: Static and Sticky Toolbar

### List of Changes

#### 1. Add Static Toolbar
Simply put, the toolbar appears above the editor and only disappears when the user leaves the editor.

This mostly consisted of adding `if ( !this.options.staticToolbar ) {` around places that the toolbar gets hidden.

Configure with; `staticToolbar: true` in the editor options.

#### 2. Add Sticky Toolbar
Combined with `staticToolbar`, this will keep the toolbar at the top of the window while scrolling over the editor.

Configure with; `stickyToolbar: true` in the editor options.

#### 3. No longer use 'blur' on the editor to hide toolbar
This now uses event listeners and determines if you have clicked or focused outside of the editor, or the toolbar (the toolbar counts as part of the editor). Uses the new `isDescendant` function.

#### 4. Add Classes to toolbar types
The transition css caused issues with the static toolbar so I added new classes. `.static-toolbar` which is added to the static toolbar. `sticky-toolbar` for when the toolbar is stuck to the top of the window while scrolling, and `stalker-toolbar` which is the current toolbar that follows the selection.

#### 5. New demo page
A demo with two editors, one static, one stalker (/demos/static-toolbar.html)

#### 6. Various improvements / changes
I moved out the placeholder functions. I created a `bindElementActions` function which now runs all the element related `bind` functions which have been moved out along with a new `bindClick` function which 'activates' the editor toolbar. I moved around the setToolbarPosition function a bit to deal with the static and sticky positioning.

Would love some help testing. Have tested in Chrome and Firefox only so far.