diff options
| author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-06-17 11:35:18 +0900 | 
|---|---|---|
| committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-06-17 11:42:34 +0900 | 
| commit | 45a65b38db55e358d58e9c608a8088d7cc157939 (patch) | |
| tree | b0c141f40007207c0fa87aefe9ebd28b4633ad10 /src/content/actions | |
| parent | 0496d7e2691d9349294fdf0ef78a31fd23c4bc42 (diff) | |
Fix no previous search keywords
Diffstat (limited to 'src/content/actions')
| -rw-r--r-- | src/content/actions/find.js | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/src/content/actions/find.js b/src/content/actions/find.js index c7345cc..249a8a9 100644 --- a/src/content/actions/find.js +++ b/src/content/actions/find.js @@ -22,6 +22,12 @@ const postPatternFound = (pattern) => {    );  }; +const postNoPrevious = () => { +  return consoleFrames.postError( +    window.document, +    'No previous search keywords'); +}; +  const find = (string, backwards) => {    let caseSensitive = false;    let wrapScan = true; @@ -50,6 +56,9 @@ const findNext = (currentKeyword, reset, backwards) => {    }    return promise.then((keyword) => { +    if (!keyword) { +      return postNoPrevious(); +    }      let found = find(keyword, backwards);      if (!found) {        window.getSelection().removeAllRanges();  | 
