Changeset 57592 in webkit


Ignore:
Timestamp:
Apr 14, 2010 11:42:10 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-14 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Console: Shift-Tab does not cycle autocompletions in the reverse order
https://bugs.webkit.org/show_bug.cgi?id=37582

  • inspector/front-end/TextPrompt.js: (WebInspector.TextPrompt.prototype.complete): (WebInspector.TextPrompt.prototype._completionsReady): (WebInspector.TextPrompt.prototype._tabKeyPressed):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57591 r57592  
     12010-04-14  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Console: Shift-Tab does not cycle autocompletions in the reverse order
     6        https://bugs.webkit.org/show_bug.cgi?id=37582
     7
     8        * inspector/front-end/TextPrompt.js:
     9        (WebInspector.TextPrompt.prototype.complete):
     10        (WebInspector.TextPrompt.prototype._completionsReady):
     11        (WebInspector.TextPrompt.prototype._tabKeyPressed):
     12
    1132010-04-14  Jeff Schiller  <codedread@gmail.com>
    214
  • trunk/WebCore/inspector/front-end/TextPrompt.js

    r56280 r57592  
    173173    },
    174174
    175     complete: function(auto)
     175    complete: function(auto, reverse)
    176176    {
    177177        this.clearAutoComplete(true);
     
    186186            return;
    187187        var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this.completionStopCharacters, this.element, "backward");
    188         this.completions(wordPrefixRange, auto, this._completionsReady.bind(this, selection, auto, wordPrefixRange));
    189     },
    190 
    191     _completionsReady: function(selection, auto, originalWordPrefixRange, completions)
     188        this.completions(wordPrefixRange, auto, this._completionsReady.bind(this, selection, auto, wordPrefixRange, reverse));
     189    },
     190
     191    _completionsReady: function(selection, auto, originalWordPrefixRange, reverse, completions)
    192192    {
    193193        if (!completions || !completions.length)
     
    213213                    foundIndex = i;
    214214
    215             if (foundIndex === null || (foundIndex + 1) >= completions.length)
     215            var nextIndex = foundIndex + (reverse ? -1 : 1);
     216            if (foundIndex === null || nextIndex >= completions.length)
    216217                var completionText = completions[0];
     218            else if (nextIndex < 0)
     219                var completionText = completions[completions.length - 1];
    217220            else
    218                 var completionText = completions[foundIndex + 1];
     221                var completionText = completions[nextIndex];
    219222        }
    220223
     
    355358        event.stopPropagation();
    356359
    357         this.complete();
     360        this.complete(false, event.shiftKey);
    358361    },
    359362
Note: See TracChangeset for help on using the changeset viewer.