FileSystem.on( 'rename', function( event, oldName, newName ) { var todoPath = Paths.todoFile(); // Reload settings if .todo of current project was updated. if ( newName === todoPath || oldName === todoPath ) { SettingsManager.loadSettings(); } else { // Move visibility state to new file. Files.toggleExpanded( newName, Files.isExpanded( oldName ) ); Files.toggleExpanded( oldName, false ); // If not .todo, parse all files. run(); } } );
.on( 'click', '.file', function() { var $this = $( this ); // Change classes and toggle visibility of todos. $this .toggleClass( 'expanded' ) .toggleClass( 'collapsed' ); // Toggle file visibility. Files.toggleExpanded( $this.data( 'file' ), $this.hasClass( 'expanded' ) ); } )