如何设置要显示的最大对象数?

时间:2015-07-08 13:24:51

标签: javascript jquery

我有以下功能,如果里面有文件夹,它会自动创建一个新的option。但是最后一个文件夹包含一个HTML文件,并且在选择父文件夹时将自动打开HTML。在这种情况下,我不想创建另一个option

这是我创建新关卡的代码,因此我想在创建了4个option关卡后停止创建新关卡:

function processNewDFData( respObj, $currentSelectItem, strCurrentPath ) {
  fsStructure[strCurrentPath] = {'subfolders':[], 'subshtmls':[]};
  if ( (respObj.subfolders.length > 0) || (respObj.subshtmls.length > 0) ) {
    for( var i = 0; i < respObj.subfolders.length; i++ ) {
      fsStructure[strCurrentPath].subfolders.push( respObj.subfolders[i] );
    }

    for( var i = 0; i < respObj.subshtmls.length; i++ ) {
      fsStructure[strCurrentPath].subshtmls.push( respObj.subshtmls[i] );
    }
  }

  rendSelects( $currentSelectItem, strCurrentPath );
}

0 个答案:

没有答案