Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

LabelPageController

jiajunGit edited this page Jul 23, 2017 · 4 revisions

Description

The LabelPageController contains the logic used to replace the default Github color picker with its own color picker and event handlers used to react to events emitted by the installed color picker.

Comparison of color pickers

The one on the left is Github default color picker while the one on the right is the extension's own color picker:

Overview of LabelPageController

  • The function overrideDropDownMenu() replaces the default Github color picker with its own color picker.
  • handleColorBoxStyleChanges() handle color changes to the color square within the input box that let users type in their own color values. When the color of that square changes, it will update the color selected within its own color picker.
  • handleInputValueChanges() corrects the invalid color hex value (i.e. #undefined) placed in the input box after submitting the form to create new labels.
  • The stylesheet found in src/styles/colorpicker.css styles its own color picker

Future enhancements

There is some discussion about the addition of several default colors to the extension's own color picker found in issue #1. For now, the extension's own color picker has been disabled.

Built with

Spectrum - https://github.com/bgrins/spectrum