Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

default color selecting by table's index #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jquery.colorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
// Setup time. Clone new elements from our templates, set some IDs, make shortcuts, jazzercise.
var element = $(this),
opts = $.extend({}, $.fn.colorPicker.defaults, options),
defaultColor = $.fn.colorPicker.toHex(
(element.val().length > 0) ? element.val() : opts.pickerDefault
),
dColors = opts.colors,
elValue = (opts.pickByIndex) ? dColors[opts.pickByIndex % dColors.length ] : (element.val() || opts.pickerDefault),
defaultColor = $.fn.colorPicker.toHex(elValue),
newControl = templates.control.clone(),
newPalette = templates.palette.clone().attr('id', 'colorPicker_palette-' + cItterate),
newHexLabel = templates.hexLabel.clone(),
Expand Down