Commit 43225a39 authored by Alice Boxhall's avatar Alice Boxhall Committed by Commit Bot

[Devtools] Rename paletteColorsContainer back to paletteContainer

Several places in the code I'd overlooked were referring to "paletteContainer", so I felt it was safest to just put it back the way it was.

Bug: 792348, 792342
Change-Id: I144752c1436500d4167190060f675b0115ee8a14
Reviewed-on: https://chromium-review.googlesource.com/812584Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Commit-Queue: Alice Boxhall <aboxhall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522340}
parent 1b767095
...@@ -124,14 +124,15 @@ ColorPicker.Spectrum = class extends UI.VBox { ...@@ -124,14 +124,15 @@ ColorPicker.Spectrum = class extends UI.VBox {
this._palettes = new Map(); this._palettes = new Map();
this._palettePanel = this.contentElement.createChild('div', 'palette-panel'); this._palettePanel = this.contentElement.createChild('div', 'palette-panel');
this._palettePanelShowing = false; this._palettePanelShowing = false;
this._paletteContainer = this.contentElement.createChild('div', 'spectrum-palette'); this._paletteSectionContainer = this.contentElement.createChild('div', 'spectrum-palette-container');
this._paletteContainer = this._paletteSectionContainer.createChild('div', 'spectrum-palette');
this._paletteContainer.addEventListener('contextmenu', this._showPaletteColorContextMenu.bind(this, -1)); this._paletteContainer.addEventListener('contextmenu', this._showPaletteColorContextMenu.bind(this, -1));
this._paletteColorsContainer = this._paletteContainer.createChild('div', 'spectrum-palette-colors');
this._shadesContainer = this.contentElement.createChild('div', 'palette-color-shades hidden'); this._shadesContainer = this.contentElement.createChild('div', 'palette-color-shades hidden');
UI.installDragHandle( UI.installDragHandle(
this._paletteColorsContainer, this._paletteDragStart.bind(this), this._paletteDrag.bind(this), this._paletteContainer, this._paletteDragStart.bind(this), this._paletteDrag.bind(this),
this._paletteDragEnd.bind(this), 'default'); this._paletteDragEnd.bind(this), 'default');
var paletteSwitcher = this._paletteContainer.createChild('div', 'spectrum-palette-switcher spectrum-switcher'); var paletteSwitcher =
this._paletteSectionContainer.createChild('div', 'spectrum-palette-switcher spectrum-switcher');
appendSwitcherIcon(paletteSwitcher); appendSwitcherIcon(paletteSwitcher);
paletteSwitcher.addEventListener('click', this._togglePalettePanel.bind(this, true)); paletteSwitcher.addEventListener('click', this._togglePalettePanel.bind(this, true));
...@@ -258,7 +259,7 @@ ColorPicker.Spectrum = class extends UI.VBox { ...@@ -258,7 +259,7 @@ ColorPicker.Spectrum = class extends UI.VBox {
*/ */
_showPalette(palette, animate, event) { _showPalette(palette, animate, event) {
this._resizeForSelectedPalette(); this._resizeForSelectedPalette();
this._paletteColorsContainer.removeChildren(); this._paletteContainer.removeChildren();
for (var i = 0; i < palette.colors.length; i++) { for (var i = 0; i < palette.colors.length; i++) {
var animationDelay = animate ? i * 100 / palette.colors.length : 0; var animationDelay = animate ? i * 100 / palette.colors.length : 0;
var colorElement = this._createPaletteColor(palette.colors[i], animationDelay); var colorElement = this._createPaletteColor(palette.colors[i], animationDelay);
...@@ -277,13 +278,13 @@ ColorPicker.Spectrum = class extends UI.VBox { ...@@ -277,13 +278,13 @@ ColorPicker.Spectrum = class extends UI.VBox {
colorElement.title = Common.UIString(palette.colors[i] + '. Long-click to show alternate shades.'); colorElement.title = Common.UIString(palette.colors[i] + '. Long-click to show alternate shades.');
new UI.LongClickController(colorElement, this._showLightnessShades.bind(this, colorElement, palette.colors[i])); new UI.LongClickController(colorElement, this._showLightnessShades.bind(this, colorElement, palette.colors[i]));
} }
this._paletteColorsContainer.appendChild(colorElement); this._paletteContainer.appendChild(colorElement);
} }
this._paletteContainerMutable = palette.mutable; this._paletteContainerMutable = palette.mutable;
if (palette.mutable) { if (palette.mutable) {
this._paletteColorsContainer.appendChild(this._addColorToolbar.element); this._paletteContainer.appendChild(this._addColorToolbar.element);
this._paletteColorsContainer.appendChild(this._deleteIconToolbar.element); this._paletteContainer.appendChild(this._deleteIconToolbar.element);
} else { } else {
this._addColorToolbar.element.remove(); this._addColorToolbar.element.remove();
this._deleteIconToolbar.element.remove(); this._deleteIconToolbar.element.remove();
...@@ -318,8 +319,7 @@ ColorPicker.Spectrum = class extends UI.VBox { ...@@ -318,8 +319,7 @@ ColorPicker.Spectrum = class extends UI.VBox {
this._shadesContainer.animate( this._shadesContainer.animate(
[{transform: 'scaleY(0)', opacity: '0'}, {transform: 'scaleY(1)', opacity: '1'}], [{transform: 'scaleY(0)', opacity: '0'}, {transform: 'scaleY(1)', opacity: '1'}],
{duration: 200, easing: 'cubic-bezier(0.4, 0, 0.2, 1)'}); {duration: 200, easing: 'cubic-bezier(0.4, 0, 0.2, 1)'});
var shadesTop = var shadesTop = this._paletteContainer.offsetTop + colorElement.offsetTop + colorElement.parentElement.offsetTop;
this._paletteColorsContainer.offsetTop + colorElement.offsetTop + colorElement.parentElement.offsetTop;
if (this._contrastDetails && this._contrastDetails.visible()) if (this._contrastDetails && this._contrastDetails.visible())
shadesTop += this._contrastDetails.element().offsetHeight; shadesTop += this._contrastDetails.element().offsetHeight;
this._shadesContainer.style.top = shadesTop + 'px'; this._shadesContainer.style.top = shadesTop + 'px';
......
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
cursor: pointer; cursor: pointer;
} }
.spectrum-palette { .spectrum-palette-container {
border-top: 1px solid #dadada; border-top: 1px solid #dadada;
position: relative; position: relative;
width: 100%; width: 100%;
...@@ -391,7 +391,7 @@ ...@@ -391,7 +391,7 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.spectrum-palette-colors { .spectrum-palette {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: 198px; width: 198px;
...@@ -441,7 +441,7 @@ ...@@ -441,7 +441,7 @@
margin-left: -8px; margin-left: -8px;
} }
.spectrum-palette-colors > .spectrum-palette-color.spectrum-shades-shown { .spectrum-palette > .spectrum-palette-color.spectrum-shades-shown {
z-index: 15; z-index: 15;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment