Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: Source/WebCore/inspector/front-end/StylesSidebarPane.js

Issue 12301008: Merge 142745 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/inspector/front-end/SplitView.js ('k') | Source/WebCore/inspector/front-end/TabbedPane.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/StylesSidebarPane.js
===================================================================
--- Source/WebCore/inspector/front-end/StylesSidebarPane.js (revision 143178)
+++ Source/WebCore/inspector/front-end/StylesSidebarPane.js (working copy)
@@ -1771,7 +1771,7 @@
colorSwatch.setColorString(text);
colorSwatch.element.addEventListener("click", swatchClick, false);
- var scrollerElement = hasSpectrum ? self._parentPane._computedStylePane.element.parentElement : null;
+ var scrollerElement;
function spectrumChanged(e)
{
@@ -1785,7 +1785,8 @@
function spectrumHidden(event)
{
- scrollerElement.removeEventListener("scroll", repositionSpectrum, false);
+ if (scrollerElement)
+ scrollerElement.removeEventListener("scroll", repositionSpectrum, false);
var commitEdit = event.data;
var propertyText = !commitEdit && self.originalPropertyText ? self.originalPropertyText : (nameElement.textContent + ": " + valueElement.textContent);
self.applyStyleText(propertyText, true, true, false);
@@ -1817,7 +1818,11 @@
spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged, spectrumChanged);
spectrumHelper.addEventListener(WebInspector.SpectrumPopupHelper.Events.Hidden, spectrumHidden);
- scrollerElement.addEventListener("scroll", repositionSpectrum, false);
+ scrollerElement = colorSwatch.element.enclosingNodeOrSelfWithClass("scroll-target");
+ if (scrollerElement)
+ scrollerElement.addEventListener("scroll", repositionSpectrum, false);
+ else
+ console.error("Unable to handle color picker scrolling");
}
}
e.consume(true);
« no previous file with comments | « Source/WebCore/inspector/front-end/SplitView.js ('k') | Source/WebCore/inspector/front-end/TabbedPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698