src/extensions/default/CloseOthers/main.js
function handleClose(mode) {
        var targetIndex  = MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE)),
            workingSetList = MainViewManager.getWorkingSet(MainViewManager.ACTIVE_PANE),
            start        = (mode === closeBelow) ? (targetIndex + 1) : 0,
            end          = (mode === closeAbove) ? (targetIndex) : (workingSetList.length),
            files        = [],
            i;

        for (i = start; i < end; i++) {
            if ((mode === closeOthers && i !== targetIndex) || (mode !== closeOthers)) {
                files.push(workingSetList[i]);
            }
        }

        CommandManager.execute(Commands.FILE_CLOSE_LIST, {fileList: files});
    }
function handleClose(mode) {
        var targetIndex  = MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE)),
            workingSetList = MainViewManager.getWorkingSet(MainViewManager.ACTIVE_PANE),
            start        = (mode === closeBelow) ? (targetIndex + 1) : 0,
            end          = (mode === closeAbove) ? (targetIndex) : (workingSetList.length),
            files        = [],
            i;

        for (i = start; i < end; i++) {
            if ((mode === closeOthers && i !== targetIndex) || (mode !== closeOthers)) {
                files.push(workingSetList[i]);
            }
        }

        CommandManager.execute(Commands.FILE_CLOSE_LIST, {fileList: files});
    }
function handleClose ( mode ) { var targetIndex = MainViewManager . findInWorkingSet ( MainViewManager . ACTIVE_PANE , MainViewManager . getCurrentlyViewedPath ( MainViewManager . ACTIVE_PANE ) ) , workingSetList = MainViewManager . getWorkingSet ( MainViewManager . ACTIVE_PANE ) , start = ( mode === closeBelow ) ? ( targetIndex + 1 ) : 0 , end = ( mode === closeAbove ) ? ( targetIndex ) : ( workingSetList . length ) , files = [ ] , i ; for ( i = start ; i < end ; i ++ ) { if ( ( mode === closeOthers && i !== targetIndex ) || ( mode !== closeOthers ) ) { files . push ( workingSetList [ i ] ) ; } } CommandManager . execute ( Commands . FILE_CLOSE_LIST , { fileList : files } ) ; }
Handle the different Close Other commands
@param {string} mode
Handle the different Close Other commands