added EsC key to cancel search
This commit is contained in:
parent
60e9a85140
commit
e67a520a24
2 changed files with 16 additions and 9 deletions
16
app/assets/javascripts/jquery/EveryPage.js
vendored
16
app/assets/javascripts/jquery/EveryPage.js
vendored
|
@ -89,9 +89,9 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var closeSearch = function (closeAfter) {
|
var closeSearch = function (closeAfter, bypass) {
|
||||||
lT = setTimeout(function () {
|
lT = setTimeout(function () {
|
||||||
if (!sliding1 && searchIsOpen && $('.sidebarSearchField').val() == '') {
|
if (!sliding1 && searchIsOpen && (bypass || $('.sidebarSearchField').val() == '')) {
|
||||||
sliding1 = true;
|
sliding1 = true;
|
||||||
$('.sidebarSearchField, .sidebarSearch .tt-hint').css({
|
$('.sidebarSearchField, .sidebarSearch .tt-hint').css({
|
||||||
padding: '5px 0',
|
padding: '5px 0',
|
||||||
|
@ -112,7 +112,7 @@ $(document).ready(function () {
|
||||||
$(".sidebarSearch").hover(function () {
|
$(".sidebarSearch").hover(function () {
|
||||||
openSearch()
|
openSearch()
|
||||||
}, function () {
|
}, function () {
|
||||||
closeSearch(800)
|
closeSearch(800, false)
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.sidebarSearchIcon').click(function (e) {
|
$('.sidebarSearchIcon').click(function (e) {
|
||||||
|
@ -122,10 +122,11 @@ $(document).ready(function () {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
$('body').click(function (e) {
|
$('body').click(function (e) {
|
||||||
closeSearch(0);
|
closeSearch(0, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// if the search is closed and user hits SHIFT+S
|
// if the search is closed and user hits ctrl+/
|
||||||
|
// close if they hit ESC
|
||||||
$('body').bind('keydown', function (e) {
|
$('body').bind('keydown', function (e) {
|
||||||
switch (e.which) {
|
switch (e.which) {
|
||||||
case 191:
|
case 191:
|
||||||
|
@ -133,6 +134,11 @@ $(document).ready(function () {
|
||||||
openSearch();
|
openSearch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 27:
|
||||||
|
if (searchIsOpen) {
|
||||||
|
closeSearch(0, true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break; //console.log(e.which);
|
break; //console.log(e.which);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
ISSAD::Application.routes.draw do
|
ISSAD::Application.routes.draw do
|
||||||
|
|
||||||
resources :in_metacode_sets
|
|
||||||
resources :metacode_sets, :except => [:show]
|
|
||||||
resources :metacodes, :except => [:show, :destroy]
|
|
||||||
|
|
||||||
root to: 'main#home', via: :get
|
root to: 'main#home', via: :get
|
||||||
|
|
||||||
|
get '/join', to: redirect('/users/sign_up')
|
||||||
|
|
||||||
match 'request', to: 'main#requestinvite', via: :get, as: :request
|
match 'request', to: 'main#requestinvite', via: :get, as: :request
|
||||||
match 'paq', to: 'main#paq', via: :get, as: :paq
|
match 'paq', to: 'main#paq', via: :get, as: :paq
|
||||||
|
@ -18,6 +16,9 @@ ISSAD::Application.routes.draw do
|
||||||
match 'topics/:map_id/:topic_id/removefrommap', to: 'topics#removefrommap', via: :post, as: :removefrommap
|
match 'topics/:map_id/:topic_id/removefrommap', to: 'topics#removefrommap', via: :post, as: :removefrommap
|
||||||
match 'synapses/:map_id/:synapse_id/removefrommap', to: 'synapses#removefrommap', via: :post, as: :removefrommap
|
match 'synapses/:map_id/:synapse_id/removefrommap', to: 'synapses#removefrommap', via: :post, as: :removefrommap
|
||||||
|
|
||||||
|
resources :in_metacode_sets
|
||||||
|
resources :metacode_sets, :except => [:show]
|
||||||
|
resources :metacodes, :except => [:show, :destroy]
|
||||||
resources :topics, except: [:index, :new, :edit] do
|
resources :topics, except: [:index, :new, :edit] do
|
||||||
get :autocomplete_topic, :on => :collection
|
get :autocomplete_topic, :on => :collection
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue