application/static/javascripts/projects/controllers/projects.controller.js
//Fetch file and on select add it to the editor
Fetch file and on select add it to the editor
Fetch file and on select add it to the editor
function new_node(dir, data) {
        return {
          label: data.title,
          onSelect: function(branch){
            $scope.selected_node = branch.data;
            $scope.selected_root = false;
            if($scope.selected_node.f_type == 'folder')
              get_children(branch, $scope.selected_node.id);
            else{
              if(open_files.indexOf(branch.data.id) == -1){
                open_branches.push(branch);
                $scope.tabs.push({title: branch.data.title, content: branch.data.content, node: branch.data, save_status: false, set_points: false, point_start: 'start', point_end: 'end'});
                open_files.push(branch.data.id);
                $scope.mode = $scope.modes[mode_endings.indexOf(branch.data.f_type)];
              }
              else {
                $scope.selectedIndex = open_files.indexOf(branch.data.id);
              }
            }
            $scope.selected_branch = branch;
          },
          data: data,
          noLeaf: dir
        };
      }
function new_node ( dir , data ) { return { label : data . title , onSelect : function ( branch ) { $scope . selected_node = branch . data ; $scope . selected_root = false ; if ( $scope . selected_node . f_type == 'folder' ) get_children ( branch , $scope . selected_node . id ) ; else { if ( open_files . indexOf ( branch . data . id ) == - 1 ) { open_branches . push ( branch ) ; $scope . tabs . push ( { title : branch . data . title , content : branch . data . content , node : branch . data , save_status : false , set_points : false , point_start : 'start' , point_end : 'end' } ) ; open_files . push ( branch . data . id ) ; $scope . mode = $scope . modes [ mode_endings . indexOf ( branch . data . f_type ) ] ; } else { $scope . selectedIndex = open_files . indexOf ( branch . data . id ) ; } } $scope . selected_branch = branch ; } , data : data , noLeaf : dir } ; }
Fetch file and on select add it to the editor
Fetch file and on select add it to the editor