File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
packages/app/src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ type Props = {
2424 parentShortid : string ,
2525 sandboxTemplate : string ,
2626 mainModuleId : string ,
27+ markTabsNotDirty : ?Function ,
2728} ;
2829
2930export default class DirectoryChildren extends React . PureComponent < Props > {
@@ -47,6 +48,7 @@ export default class DirectoryChildren extends React.PureComponent<Props> {
4748 deleteEntry,
4849 currentModuleId,
4950 isInProjectView,
51+ markTabsNotDirty,
5052 } = this . props ;
5153
5254 return (
@@ -68,6 +70,7 @@ export default class DirectoryChildren extends React.PureComponent<Props> {
6870 directories = { directories }
6971 currentModuleId = { currentModuleId }
7072 isInProjectView = { isInProjectView }
73+ markTabsNotDirty = { markTabsNotDirty }
7174 />
7275 ) ) }
7376 { modules . filter ( x => x . directoryShortid === parentShortid ) . map ( m => {
@@ -95,6 +98,7 @@ export default class DirectoryChildren extends React.PureComponent<Props> {
9598 isInProjectView = { isInProjectView }
9699 isMainModule = { mainModule }
97100 moduleHasError = { hasError }
101+ markTabsNotDirty = { markTabsNotDirty }
98102 />
99103 ) ;
100104 } ) }
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ type Props = {
4141 isInProjectView : boolean , // eslint-disable-line
4242 moduleHasError : boolean ,
4343 closeTree : ?( ) => void , // eslint-disable-line
44+ markTabsNotDirty : Function ,
4445} ;
4546
4647type State = {
@@ -174,6 +175,7 @@ class Entry extends React.PureComponent<Props, State> {
174175 onCreateDirectoryClick,
175176 deleteEntry,
176177 onClick,
178+ markTabsNotDirty,
177179 rename,
178180 isNotSynced,
179181 isMainModule,
@@ -186,6 +188,7 @@ class Entry extends React.PureComponent<Props, State> {
186188 < div >
187189 < EntryContainer
188190 onClick = { setCurrentModule ? this . setCurrentModule : onClick }
191+ onDoubleClick = { markTabsNotDirty }
189192 depth = { depth }
190193 nameValidationError = { error }
191194 active = { active }
Original file line number Diff line number Diff line change @@ -220,6 +220,10 @@ class DirectoryEntry extends React.PureComponent {
220220 sandboxActions . setCurrentModule ( sandboxId , moduleId ) ;
221221 } ;
222222
223+ markTabsNotDirty = ( ) => {
224+ this . props . sandboxActions . markTabsNotDirty ( this . props . sandboxId ) ;
225+ } ;
226+
223227 render ( ) {
224228 const {
225229 id,
@@ -291,6 +295,7 @@ class DirectoryEntry extends React.PureComponent {
291295 setCurrentModule = { this . setCurrentModule }
292296 currentModuleId = { currentModuleId }
293297 isInProjectView = { isInProjectView }
298+ markTabsNotDirty = { this . markTabsNotDirty }
294299 />
295300 { creating === 'module' && (
296301 < Entry
You can’t perform that action at this time.
0 commit comments