diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 0f9b60583d..5b6fb6e1ed 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -343,25 +343,35 @@ function locateNewLib(type, objectID, libID) */ function setSavePath() { + var getSubPath = function($obj) + { + var $td = $obj.parent(); + var usePicker = $td.find('.picker').length == 1; + var subPath = $obj.find('option:checked').text(); + if(usePicker) subPath = $td.find('.picker .picker-selection-text').text(); + return subPath; + } + savePath = defaultSave; if($('#modalBasicInfo #product').length == 1) { - savePath += $('#modalBasicInfo #product option:checked').text() + '/'; + savePath += getSubPath($('#modalBasicInfo #product')) + '/'; } else if($('#modalBasicInfo #project').length == 1 && $('#modalBasicInfo #execution').length == 0) { - savePath += $('#modalBasicInfo #project option:checked').text() + '/'; + savePath += getSubPath($('#modalBasicInfo #project')) + '/'; } else if($('#modalBasicInfo #project').length == 1 && $('#modalBasicInfo #execution').length == 1) { - if($('#modalBasicInfo #execution').val() == '') savePath += $('#modalBasicInfo #project option:checked').text() + '/'; - if($('#modalBasicInfo #execution').val() != '') savePath += $('#modalBasicInfo #execution option:checked').text() + '/'; + var executionID = $('#modalBasicInfo #execution').val(); + if(executionID == '0' || executionID == '') savePath += getSubPath($('#modalBasicInfo #project')) + '/'; + if(executionID != '0' && executionID != '') savePath += getSubPath($('#modalBasicInfo #execution')) + '/'; } else if($('#modalBasicInfo #execution').length == 1) { - savePath += $('#modalBasicInfo #execution option:checked').text() + '/'; + savePath += getSubPath($('#modalBasicInfo #execution')) + '/'; } - savePath += $('#modalBasicInfo #module option:checked').text(); + savePath += getSubPath($('#modalBasicInfo #module')); $('#savePath').html(savePath).attr('title', savePath); } diff --git a/module/doc/view/createtexttype.html.php b/module/doc/view/createtexttype.html.php index 29fef3b581..079f223b97 100644 --- a/module/doc/view/createtexttype.html.php +++ b/module/doc/view/createtexttype.html.php @@ -68,7 +68,7 @@