Merge branch 'xuan_fix_global_search' into 'master'

* fix getBoundingClientRect of undefined.

See merge request easycorp/zentaopms!6225
This commit is contained in:
王怡栋
2022-11-17 06:54:09 +00:00
+2 -2
View File
@@ -564,7 +564,7 @@
/* The magic number "111" is the space between dropdown trigger
btn and the bottom of screen */
var listStyle = {maxHeight: 'initial', top: moreMenuHeight > 111 ? 111 - moreMenuHeight : ''};
if($list[0].getBoundingClientRect)
if($list[0] && $list[0].getBoundingClientRect)
{
var btnBounding = $list.prev('a')[0].getBoundingClientRect();
if(btnBounding.height)
@@ -803,7 +803,7 @@ $(function()
{
var val = $searchQuery.val();
var searchType = changeSearchObject();
if(val !== null && val !== "")
if(val)
{
var isQuickGo = !reg.test(val);
$dropmenu.toggleClass('show-quick-go', isQuickGo);