function _onFocusInputName(){
            elements.colorsWrap.show();

            var categoryName = elements.inputCategory.val().trim();
            var labelColor = _isNewCategory(categoryName) ? _getRandomColorCodeInPreset()
                                                          : _getFirstItemColorInCategory(categoryName);

            if(elements.inputColor.val().length === 0){
                elements.inputColor.val(labelColor);
                _updateInputBySelectedColor(elements.inputName, elements.inputColor, labelColor);
            }
        }
"focus" event handler of inputName

Shows preset color buttons, and fills inputColor with color code if it is empty.
Random color if entered category name is not exists before,
or color of first item in category if the category exists.

@private