Skip to content

Commit

Permalink
[github-111][fix]: (close #111)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry.astafyev authored and marcmo committed Feb 16, 2018
1 parent a679c40 commit e1fef30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export class TopBarSearchRequest implements AfterContentInit{
this.delayTimer = setTimeout(this.trigger_SEARCH_REQUEST_CHANGED.bind(this, event), SETTINGS.TYPING_DELAY);
} else if (event.keyCode === 13) {
this.trigger_SEARCH_REQUEST_CHANGED(event);
} else {
this.lastRequest = null;
}
}

Expand Down
19 changes: 13 additions & 6 deletions app/client/src/app/views/search.results/tab.results/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export class TabControllerSearchResults extends TabController implements ViewInt
request['onChange'] = this.onRequestChange.bind(this, request.GUID);
return request;
});
this.checkOnOffMode();
this.forceUpdate();
}

Expand All @@ -273,6 +274,7 @@ export class TabControllerSearchResults extends TabController implements ViewInt
onChangeState(GUID: string, active: boolean){
Events.trigger(Configuration.sets.SYSTEM_EVENTS.REQUESTS_HISTORY_UPDATED_OUTSIDE, this._requests.map((request)=>{
GUID === request.GUID && (request.active = active);
this.checkOnOffMode();
return this.clearHandles(
Object.assign({}, request)
);
Expand Down Expand Up @@ -345,8 +347,17 @@ export class TabControllerSearchResults extends TabController implements ViewInt
}));
}

onOffOn(){
this.onOffLabel = this.onOffLabel === ON_OFF.ON ? ON_OFF.OFF : ON_OFF.ON;
checkOnOffMode(){
if (this.requests.length === 0) {
this.onOffLabel = ON_OFF.ON;
} else {
this.onOffLabel = ON_OFF.OFF;
}
//this.onOffOn(null, true);
}

onOffOn(event: MouseEvent, noChange: boolean = false){
!noChange && (this.onOffLabel = this.onOffLabel === ON_OFF.ON ? ON_OFF.OFF : ON_OFF.ON);
switch (this.onOffLabel){
case ON_OFF.OFF:
Events.trigger(Configuration.sets.SYSTEM_EVENTS.REQUESTS_HISTORY_UPDATED_OUTSIDE, this._requests.map((request)=>{
Expand Down Expand Up @@ -730,10 +741,6 @@ export class TabControllerSearchResults extends TabController implements ViewInt
this.updateRows();
}

serializeHTML(html: string){
return html.replace(/</gi, '&lt').replace(/>/gi, '&gt');
}

synchCounting(){
this.requests.forEach((request: Request) => {
this._requests.forEach((_request: Request) => {
Expand Down

0 comments on commit e1fef30

Please sign in to comment.