From 953b433c09e00f1fd3f4e78c64e580f2a479dc68 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 15 Mar 2018 16:48:12 +0800 Subject: [PATCH] * Fix a bug for export case in onlyTest flow. --- module/testcase/js/browse.js | 2 +- www/js/my.full.js | 44 ++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/module/testcase/js/browse.js b/module/testcase/js/browse.js index 0d3aeb0ae0..30ae79b50c 100644 --- a/module/testcase/js/browse.js +++ b/module/testcase/js/browse.js @@ -51,7 +51,7 @@ $(document).ready(function() $('#modulemenu > .nav').append($('#featurebar > .submenu').html()); toggleSearch(); - $('.export').modalTrigger({width:650, type:'iframe'}); + $('.export').modalTrigger({width:650, type:'iframe', afterShown: setCheckedCookie}) $('#modulemenu > .nav > li').removeClass('active'); $('#modulemenu > .nav > li[data-id=' + browseType + ']').addClass('active'); diff --git a/www/js/my.full.js b/www/js/my.full.js index dff96be3c1..1f3683655a 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -609,7 +609,7 @@ function setImageSize(image, maxWidth) function setModalTriggerLink() { $('.repolink').modalTrigger({width:960, type:'iframe'}); - $(".export").modalTrigger({width:650, type:'iframe'}); + $('.export').modalTrigger({width:650, type:'iframe', afterShown: setCheckedCookie}) } /** @@ -1355,6 +1355,30 @@ function setModal4List(triggerClass, replaceID, callback, width) }); } +/** + * Set checked in cookie. + * + * @access public + * @return void + */ +function setCheckedCookie() +{ + var checkeds = ''; + $(':checkbox').each(function() + { + if($(this).attr('checked')) + { + if(!isNaN($(this).val())) + { + var checkedVal = parseInt($(this).val()); + if(checkedVal != 0) checkeds = checkeds + checkedVal + ','; + } + } + }) + if(checkeds != '') checkeds = checkeds.substring(0, checkeds.length - 1); + $.cookie('checkedItem', checkeds, {expires:config.cookieLife, path:config.webRoot}); +} + /** * Set table behavior * @@ -2056,24 +2080,6 @@ $(document).ready(function() if(needPing) setTimeout('setPing()', 1000 * 60 * 10); // After 10 minutes, begin ping. - $('.export').bind('click', function() - { - var checkeds = ''; - $(':checkbox').each(function() - { - if($(this).attr('checked')) - { - if(!isNaN($(this).val())) - { - var checkedVal = parseInt($(this).val()); - if(checkedVal != 0) checkeds = checkeds + checkedVal + ','; - } - } - }) - if(checkeds != '') checkeds = checkeds.substring(0, checkeds.length - 1); - $.cookie('checkedItem', checkeds, {expires:config.cookieLife, path:config.webRoot}); - }); - initPrioritySelector(); initHotKey(); initHelpLink();