From 59f67a3ad81892b6b6faebc60eaef62f4b8c0b17 Mon Sep 17 00:00:00 2001 From: Nate Mielnik Date: Tue, 14 Jun 2016 01:12:04 -0400 Subject: [PATCH] Improve documentation for toolbar.relativeContainer option --- OPTIONS.md | 10 ++++++++++ README.md | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/OPTIONS.md b/OPTIONS.md index 0e9416272..be7074be9 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -203,6 +203,7 @@ var editor = new MediumEditor('.editable', { diffTop: -10, firstButtonClass: 'medium-editor-button-first', lastButtonClass: 'medium-editor-button-last', + relativeContainer: null, standardizeSelectionStart: false, static: false, @@ -250,6 +251,15 @@ CSS class added to the first button in the toolbar. CSS class added to the last button in the toolbar. +*** +#### `relativeContainer` +**Default:** `null` + +DOMElement to append the toolbar to instead of the body. When an element is passed the toolbar will also be positioned `relative` instead of `absolute`, which means the editor will not attempt to manually position the toolbar automatically. + +**NOTE:** +* Using this in combination with the `static` option for toolbar is not explicitly supported and the behavior in this case is not defined. + *** #### `standardizeSelectionStart` **Default:** `false` diff --git a/README.md b/README.md index d2d60297a..2aa83c2c8 100644 --- a/README.md +++ b/README.md @@ -137,9 +137,9 @@ var editor = new MediumEditor('.editable', { diffTop: -10, firstButtonClass: 'medium-editor-button-first', lastButtonClass: 'medium-editor-button-last', + relativeContainer: null, standardizeSelectionStart: false, static: false, - relativeContainer: null, /* options which only apply when static is true */ align: 'center', sticky: false, @@ -155,9 +155,9 @@ var editor = new MediumEditor('.editable', { * __diffTop__: value in pixels to be added to the Y axis positioning of the toolbar. Default: `-10` * __firstButtonClass__: CSS class added to the first button in the toolbar. Default: `'medium-editor-button-first'` * __lastButtonClass__: CSS class added to the last button in the toolbar. Default: `'medium-editor-button-last'` +* __relativeContainer__: DOMElement to append the toolbar to instead of the body. When passed, the toolbar will also be positioned `relative` instead of `absolute`. Default: `null` * __standardizeSelectionStart__: enables/disables standardizing how the beginning of a range is decided between browsers whenever the selected text is analyzed for updating toolbar buttons status. Default: `false` * __static__: enable/disable the toolbar always displaying in the same location relative to the medium-editor element. Default: `false` -* __relativeContainer__: Toolbar is appended relative to a given DOM-Node instead of appending it to the body and position it absolute. ##### Options which only apply when the `static` option is being used: * __align__: `left`|`center`|`right` - When the __static__ option is `true`, this aligns the static toolbar relative to the medium-editor element. Default: `center`