FIX: Pressing Ctrl+F twice should show browser find
This commit is contained in:
parent
fa0f731427
commit
d10741170f
|
@ -3,7 +3,7 @@ import DiscourseURL from 'discourse/lib/url';
|
||||||
const bindings = {
|
const bindings = {
|
||||||
'!': {postAction: 'showFlags'},
|
'!': {postAction: 'showFlags'},
|
||||||
'#': {handler: 'toggleProgress', anonymous: true},
|
'#': {handler: 'toggleProgress', anonymous: true},
|
||||||
'/': {handler: 'showSearch', anonymous: true},
|
'/': {handler: 'toggleSearch', anonymous: true},
|
||||||
'=': {handler: 'toggleHamburgerMenu', anonymous: true},
|
'=': {handler: 'toggleHamburgerMenu', anonymous: true},
|
||||||
'?': {handler: 'showHelpModal', anonymous: true},
|
'?': {handler: 'showHelpModal', anonymous: true},
|
||||||
'.': {click: '.alert.alert-info.clickable', anonymous: true}, // show incoming/updated topics
|
'.': {click: '.alert.alert-info.clickable', anonymous: true}, // show incoming/updated topics
|
||||||
|
@ -142,6 +142,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
showBuiltinSearch() {
|
showBuiltinSearch() {
|
||||||
|
if (this.container.lookup('controller:header').get('searchVisible')) {
|
||||||
|
this.toggleSearch();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
this.searchService.set('searchContextEnabled', false);
|
this.searchService.set('searchContextEnabled', false);
|
||||||
|
|
||||||
const currentPath = this.container.lookup('controller:application').get('currentPath'),
|
const currentPath = this.container.lookup('controller:application').get('currentPath'),
|
||||||
|
@ -157,7 +162,7 @@ export default {
|
||||||
|
|
||||||
if (showSearch) {
|
if (showSearch) {
|
||||||
this.searchService.set('searchContextEnabled', true);
|
this.searchService.set('searchContextEnabled', true);
|
||||||
this.showSearch();
|
this.toggleSearch();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +181,7 @@ export default {
|
||||||
this.container.lookup('controller:topic-progress').send('toggleExpansion', {highlight: true});
|
this.container.lookup('controller:topic-progress').send('toggleExpansion', {highlight: true});
|
||||||
},
|
},
|
||||||
|
|
||||||
showSearch() {
|
toggleSearch() {
|
||||||
this.container.lookup('controller:header').send('toggleSearch');
|
this.container.lookup('controller:header').send('toggleSearch');
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue