Home

# Class goog.ui.PopupColorPicker

Popup color picker widget.

extends goog.ui.Component

Instance Method Summary
| `addColors(?Array.<string> colors)` Add an array of colors to the colors displayed by the color picker. Does not add duplicated colors.
| `attach(?Element element)` Attaches the popup color picker to an element.
| `canDecorate(?Element element) ⇒ boolean` ColorPickers cannot be used to decorate pre-existing html, since the structure they build is fairly complicated.
| `clearColors()` Clear the colors displayed by the color picker.
| `createDom()` Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
| `detach(?Element element)` Detatches the popup color picker from an element.
| `disposeInternal()` Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
| `getAllowAutoFocus() ⇒ boolean`
| `getAutoHide() ⇒ boolean` Returns whether the Popup dismisses itself when the user clicks outside of it.
| `getAutoHideRegion() ⇒ ?Element` Returns the region inside which the Popup dismisses itself when the user clicks, or null if it was not set. Null indicates the entire document is the autohide region.
| `getColorPicker() ⇒ ?goog.ui.ColorPicker`
| `getLastTarget() ⇒ ?Element`
| `getPopup() ⇒ ?goog.ui.PopupBase` Returns the {@link goog.ui.PopupBase} from this picker. Returns null if the popup has not yet been created. NOTE: This should *ONLY* be called from tests. If called before createDom(), this should return null.
| `getRememberSelection() ⇒ boolean`
| `getSelectedColor() ⇒ ?string` Gets the color that is currently selected in this color picker.
| `getToggleMode() ⇒ boolean` Gets whether the colorpicker is in toggle mode
| `onColorPicked_(?goog.events.Event e)` Handles the color change event.
| `setAllowAutoFocus(boolean allow)` Sets whether the color picker can automatically move focus to its key event target when it is set to visible.
| `setAutoHide(boolean autoHide)` Sets whether the Popup dismisses itself when the user clicks outside of it - must be called after the Popup has been created (in createDom()), otherwise it does nothing.
| `setAutoHideRegion(?Element element)` Sets the region inside which the Popup dismisses itself when the user clicks - must be called after the Popup has been created (in createDom()), otherwise it does nothing.
| `setFocusable(boolean focusable)` Sets whether the color picker can accept focus.
| `setPinnedCorner(?goog.positioning.Corner corner)` Set the pinned corner of the popup.
| `setPopupCorner(?goog.positioning.Corner corner)` Sets which corner of the attaching element this popup shows up.
| `setRememberSelection(boolean remember)` Sets whether the picker remembers the last selected color between popups.
| `setToggleMode(boolean toggle)` Sets whether the color picker should toggle off if it is already open.
| `show_(?goog.events.BrowserEvent e)` Handles click events on the targets and shows the color picker.