Changeset 112531 in webkit


Ignore:
Timestamp:
Mar 29, 2012 7:43:24 AM (12 years ago)
Author:
caseq@chromium.org
Message:

Web Inspector: on a single click in Timeline overview, make a minimal selection centered around cursor
https://bugs.webkit.org/show_bug.cgi?id=82616

Reviewed by Pavel Feldman.

  • inspector/front-end/TimelineOverviewPane.js:

(WebInspector.TimelineOverviewWindow): Explicitly handle single click on overview by creating a minimal window around cursor.
(WebInspector.TimelineOverviewWindow.prototype._resizeWindowMinimum):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112530 r112531  
     12012-03-29  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: on a single click in Timeline overview, make a minimal selection centered around cursor
     4        https://bugs.webkit.org/show_bug.cgi?id=82616
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/front-end/TimelineOverviewPane.js:
     9        (WebInspector.TimelineOverviewWindow): Explicitly handle single click on overview by creating a minimal window around cursor.
     10        (WebInspector.TimelineOverviewWindow.prototype._resizeWindowMinimum):
     11
    1122012-03-29  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
    213
  • trunk/Source/WebCore/inspector/front-end/TimelineOverviewPane.js

    r112528 r112531  
    369369    this._parentElement.addEventListener("mousewheel", this.scrollWindow.bind(this), true);
    370370    this._parentElement.addEventListener("dblclick", this._resizeWindowMaximum.bind(this), true);
     371    this._parentElement.addEventListener("click", this._resizeWindowMinimum.bind(this), true);
    371372
    372373    this._overviewWindowElement = document.createElement("div");
     
    510511    {
    511512        this._setWindowPosition(0, this._parentElement.clientWidth);
     513    },
     514
     515    _resizeWindowMinimum: function(event)
     516    {
     517        WebInspector.elementDragEnd(event);
     518        var middle = event.pageX - this._parentElement.offsetLeft;
     519        var start = Math.max(middle - WebInspector.TimelineOverviewPane.MinSelectableSize / 2, 0);
     520        var end = Math.min(middle + WebInspector.TimelineOverviewPane.MinSelectableSize / 2, this._parentElement.clientWidth);
     521        this._setWindowPosition(start, end);
    512522    },
    513523
Note: See TracChangeset for help on using the changeset viewer.