- for (i in settings.gradients) {
- if (settings.gradients.hasOwnProperty(i)) {
- $('.color-preview').once('color').append('<div id="gradient-' + i + '"></div>');
- var gradient = $('.color-preview #gradient-' + i);
-
- height.push(parseInt(gradient.css('height'), 10) / 10);
-
- width.push(parseInt(gradient.css('width'), 10) / 10);
-
- for (j = 0; j < (settings.gradients[i].direction === 'vertical' ? height[i] : width[i]); ++j) {
- gradient.append('<div class="gradient-line"></div>');
- }
- }
- }
-
- form.find('#edit-scheme').on('change', function () {
- var schemes = settings.color.schemes;
- var colorScheme = this.options[this.selectedIndex].value;
- if (colorScheme !== '' && schemes[colorScheme]) {
- colors = schemes[colorScheme];
- for (var fieldName in colors) {
- if (colors.hasOwnProperty(fieldName)) {
- callback($('#edit-palette-' + fieldName), colors[fieldName], false, true);
- }
- }
- preview();
- }
- });
-