-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Delete File and Delete Gist in more contextually appropriate places
- Loading branch information
Showing
14 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import * as React from 'react'; | ||
import { queryString, splitOnLast } from 'servicestack-client'; | ||
import { UA, getSortedFileNames, IGistFile } from './utils'; | ||
import { UA, getSortedFileNames, IGistFile, FileNames } from './utils'; | ||
|
||
import CodeMirror from 'react-codemirror'; | ||
import "jspm_packages/npm/[email protected]/addon/edit/matchbrackets.js"; | ||
|
@@ -149,7 +149,12 @@ export default class Editor extends React.Component<any, any> { | |
<div className={active ? 'active' : null} | ||
onClick={e => !active ? this.props.selectFileName(fileName) : this.props.editFileName(fileName) }> | ||
{this.props.editingFileName !== fileName | ||
? <b>{fileName}</b> | ||
? <b> | ||
{fileName} | ||
{ this.props.isOwner && active && FileNames.canDelete(fileName) | ||
? <i className="material-icons delete" onClick={e => e.stopPropagation() || confirm(`Are you sure you want to delete file '${fileName}'?`) ? this.props.onDeleteFile(fileName) : null } title="delete file">cancel</i> | ||
: null} | ||
</b> | ||
: <input type="text" className="txtFileName" | ||
onBlur={e => this.props.onRenameFile(fileName, e) } | ||
onKeyDown={e => e.keyCode === 13 ? (e.target as HTMLElement).blur() : null } | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.