From 4ca4c4ccdb526243d1d1a554d9eee933a1b443c8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 13 Dec 2022 17:06:14 +0800 Subject: [PATCH] * fix bug #30748. --- module/bug/control.php | 4 ++-- module/bug/js/browse.js | 2 +- module/bug/js/common.js | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 96ea49c4bf..a4b7127e33 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1801,7 +1801,7 @@ class bug extends control } else { - return print(js::closeModal('parent.parent')); + return print(js::closeModal('parent.parent', 'this', "typeof(parent.parent.setTitleWidth) == 'function' ? parent.parent.setTitleWidth() : parent.parent.location.reload()")); } } if(defined('RUN_MODE') && RUN_MODE == 'api') @@ -1988,7 +1988,7 @@ class bug extends control } else { - return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + return print(js::closeModal('parent.parent', 'this', "typeof(parent.parent.setTitleWidth) == 'function' ? parent.parent.setTitleWidth() : parent.parent.location.reload()")); } } if(defined('RUN_MODE') && RUN_MODE == 'api') diff --git a/module/bug/js/browse.js b/module/bug/js/browse.js index 0cc3ce246d..5c32f9e35b 100644 --- a/module/bug/js/browse.js +++ b/module/bug/js/browse.js @@ -1,6 +1,6 @@ $(function() { - if($('#bugList thead th.c-title').width() < 150) $('#bugList thead th.c-title').width(150); + setTitleWidth(); /* The display of the adjusting sidebarHeader is synchronized with the sidebar. */ $(".sidebar-toggle").click(function() diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 7134ecab5b..81920153b2 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -985,3 +985,20 @@ function setBranchRelated(branchID, productID, num) $.ajaxSettings.async = true; } } + +/** + * Set title field width. + * + * @access public + * @return void + */ +function setTitleWidth() +{ + if(window.config.currentMethod != 'browse') return false; + + if($('#bugList thead th.c-title').width() < 150) $('#bugList thead th.c-title').width(150); + setTimeout(function() + { + if($('#bugList thead th.c-title').width() < 150) $('#bugList thead th.c-title').width(150); + }, 400) +}