Title: [198026] trunk/Source/WebInspectorUI
- Revision
- 198026
- Author
- [email protected]
- Date
- 2016-03-11 10:30:13 -0800 (Fri, 11 Mar 2016)
Log Message
Web Inspector: Make it possible to disable TimelineRuler UI
https://bugs.webkit.org/show_bug.cgi?id=155348
<rdar://problem/25103505>
Reviewed by Timothy Hatcher.
Adds an "enabled" property to TimelineRuler, allowing the selection UI
to be disabled without removing the current selection.
* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler.allows-time-range-selection:not(.disabled)):
(.timeline-ruler > .selection-drag):
(.timeline-ruler:not(.disabled) > .selection-drag):
(.timeline-ruler:not(.disabled) > .selection-drag:active):
(.timeline-ruler.disabled > .selection-handle):
(.timeline-ruler.allows-time-range-selection): Deleted.
(.timeline-ruler > .selection-drag:active): Deleted.
Updated ruler styles for "disabled" state: pointer events are disabled,
selection handles hidden, and the default cursor is shown.
* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler):
(WebInspector.TimelineRuler.prototype.get enabled):
(WebInspector.TimelineRuler.prototype.set enabled):
New property.
(WebInspector.TimelineRuler.prototype._handleClick):
Corrected code which always reset the pointer events to "all", instead
of setting it back to the original value.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (198025 => 198026)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-03-11 18:02:27 UTC (rev 198025)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-03-11 18:30:13 UTC (rev 198026)
@@ -1,3 +1,34 @@
+2016-03-11 Matt Baker <[email protected]>
+
+ Web Inspector: Make it possible to disable TimelineRuler UI
+ https://bugs.webkit.org/show_bug.cgi?id=155348
+ <rdar://problem/25103505>
+
+ Reviewed by Timothy Hatcher.
+
+ Adds an "enabled" property to TimelineRuler, allowing the selection UI
+ to be disabled without removing the current selection.
+
+ * UserInterface/Views/TimelineRuler.css:
+ (.timeline-ruler.allows-time-range-selection:not(.disabled)):
+ (.timeline-ruler > .selection-drag):
+ (.timeline-ruler:not(.disabled) > .selection-drag):
+ (.timeline-ruler:not(.disabled) > .selection-drag:active):
+ (.timeline-ruler.disabled > .selection-handle):
+ (.timeline-ruler.allows-time-range-selection): Deleted.
+ (.timeline-ruler > .selection-drag:active): Deleted.
+ Updated ruler styles for "disabled" state: pointer events are disabled,
+ selection handles hidden, and the default cursor is shown.
+
+ * UserInterface/Views/TimelineRuler.js:
+ (WebInspector.TimelineRuler):
+ (WebInspector.TimelineRuler.prototype.get enabled):
+ (WebInspector.TimelineRuler.prototype.set enabled):
+ New property.
+ (WebInspector.TimelineRuler.prototype._handleClick):
+ Corrected code which always reset the pointer events to "all", instead
+ of setting it back to the original value.
+
2016-03-10 Daniel Strokis <[email protected]>
Web Inspector: color swatch and border are misaligned in Visual Styles sidebar
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css (198025 => 198026)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css 2016-03-11 18:02:27 UTC (rev 198025)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css 2016-03-11 18:30:13 UTC (rev 198026)
@@ -29,7 +29,7 @@
z-index: 1;
}
-.timeline-ruler.allows-time-range-selection {
+.timeline-ruler.allows-time-range-selection:not(.disabled) {
pointer-events: all;
}
@@ -157,11 +157,14 @@
position: absolute;
top: 0;
height: 23px;
+}
+
+.timeline-ruler:not(.disabled) > .selection-drag {
cursor: -webkit-grab;
pointer-events: all;
}
-.timeline-ruler > .selection-drag:active {
+.timeline-ruler:not(.disabled) > .selection-drag:active {
cursor: -webkit-grabbing;
}
@@ -178,6 +181,10 @@
z-index: 15;
}
+.timeline-ruler.disabled > .selection-handle {
+ display: none;
+}
+
.timeline-ruler.selection-hidden > :matches(.selection-drag, .selection-handle, .shaded-area) {
display: none;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js (198025 => 198026)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js 2016-03-11 18:02:27 UTC (rev 198025)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js 2016-03-11 18:30:13 UTC (rev 198026)
@@ -53,12 +53,27 @@
this._minimumSelectionDuration = 0.01;
this._formatLabelCallback = null;
this._timeRangeSelectionChanged = false;
+ this._enabled = true;
this._markerElementMap = new Map;
}
// Public
+ get enabled()
+ {
+ return this._enabled;
+ }
+
+ set enabled(x)
+ {
+ if (this._enabled === x)
+ return;
+
+ this._enabled = x;
+ this.element.classList.toggle(WebInspector.TreeElementStatusButton.DisabledStyleClassName, !this._enabled);
+ }
+
get allowsClippedLabels()
{
return this._allowsClippedLabels;
@@ -700,12 +715,15 @@
_handleClick(event)
{
- if (this._mouseMoved)
+ if (!this._enabled)
return;
+ if (!this._mouseMoved)
+ return;
+
this.element.style.pointerEvents = "none";
let newTarget = document.elementFromPoint(event.pageX, event.pageY);
- this.element.style.pointerEvents = "all";
+ this.element.style.pointerEvents = null;
if (newTarget && newTarget.click)
newTarget.click();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes