Improved search esc behaviour

This commit is contained in:
Igor Zhukov 2014-10-02 19:14:45 +04:00
parent e6698cb97a
commit 749c45b9af

View File

@ -220,6 +220,7 @@ angular.module('myApp.directives', ['myApp.filters'])
scrollableWrap = $('.im_dialogs_scrollable_wrap', element)[0], scrollableWrap = $('.im_dialogs_scrollable_wrap', element)[0],
searchField = $('.im_dialogs_search_field', element)[0], searchField = $('.im_dialogs_search_field', element)[0],
panelWrap = $('.im_dialogs_panel', element)[0], panelWrap = $('.im_dialogs_panel', element)[0],
searchClear = $('.im_dialogs_search_clear', element)[0],
tabsWrap = $('.im_dialogs_tabs_wrap', element)[0], tabsWrap = $('.im_dialogs_tabs_wrap', element)[0],
searchFocused = false; searchFocused = false;
@ -283,6 +284,9 @@ angular.module('myApp.directives', ['myApp.filters'])
searchField.select(); searchField.select();
} }
} }
else if (searchField.value) {
$(searchClear).trigger('click');
}
return cancelEvent(e); return cancelEvent(e);
} }