提交 7e5a2a2a 编写于 作者: W wim_spaargaren@live.nl

The show previous search term now also adds search term to history when not present

上级 c714c2fa
......@@ -23,6 +23,12 @@ export class HistoryNavigator<T> implements INavigator<T> {
this._onChange();
}
public addIfNotPresent(t: T) {
if(!this._history.contains(t)) {
this.add(t);
}
}
public next(): T {
if (this._navigator.next()) {
return this._navigator.current();
......@@ -67,4 +73,5 @@ export class HistoryNavigator<T> implements INavigator<T> {
this._history = new ArraySet<T>(data.slice(data.length - this._limit));
}
}
}
\ No newline at end of file
......@@ -174,6 +174,7 @@ export class SearchWidget extends Widget {
if (this.searchInput.getValue().length === 0) {
previous = this.searchHistory.current();
} else {
this.searchHistory.addIfNotPresent(this.searchInput.getValue());
previous = this.searchHistory.previous();
}
if (previous) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册