Skip to content

Commit 770768e

Browse files
committed
Move Delete File and Delete Gist in more contextually appropriate places
1 parent c8df947 commit 770768e

File tree

14 files changed

+56
-28
lines changed

14 files changed

+56
-28
lines changed

src/Gistlyn.Resources/app.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gistlyn.Resources/css/app.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gistlyn.Resources/css/editor.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
#tabs #files-menu:hover {
2727
color: #ffc;
2828
}
29+
#tabs .delete {
30+
font-size: 16px;
31+
vertical-align: bottom;
32+
padding: 0 0 0 5px;
33+
cursor: pointer;
34+
}
35+
#tabs .delete:hover {
36+
color: #f00;
37+
}
2938
.popup {
3039
display: none;
3140
position: absolute;

src/Gistlyn/css/codemirror.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ span.CodeMirror-selectedtext { background: none; }
358358
flex: 1;
359359
overflow: auto;
360360
}
361+
.macintel .ReactCodeMirror {
362+
margin-left: -3px;
363+
}
361364

362365
.CodeMirror {
363366
margin: 0;

src/Gistlyn/css/editor.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
#tabs #files-menu:hover {
2727
color: #ffc;
2828
}
29+
#tabs .delete {
30+
font-size: 16px;
31+
vertical-align: bottom;
32+
padding: 0 0 0 5px;
33+
cursor: pointer;
34+
}
35+
#tabs .delete:hover {
36+
color: #f00;
37+
}
2938
.popup {
3039
display: none;
3140
position: absolute;

src/Gistlyn/src/Editor.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gistlyn/src/Editor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gistlyn/src/Editor.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { queryString, splitOnLast } from 'servicestack-client';
3-
import { UA, getSortedFileNames, IGistFile } from './utils';
3+
import { UA, getSortedFileNames, IGistFile, FileNames } from './utils';
44

55
import CodeMirror from 'react-codemirror';
66
import "jspm_packages/npm/[email protected]/addon/edit/matchbrackets.js";
@@ -149,7 +149,12 @@ export default class Editor extends React.Component<any, any> {
149149
<div className={active ? 'active' : null}
150150
onClick={e => !active ? this.props.selectFileName(fileName) : this.props.editFileName(fileName) }>
151151
{this.props.editingFileName !== fileName
152-
? <b>{fileName}</b>
152+
? <b>
153+
{fileName}
154+
{ this.props.isOwner && active && FileNames.canDelete(fileName)
155+
? <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>
156+
: null}
157+
</b>
153158
: <input type="text" className="txtFileName"
154159
onBlur={e => this.props.onRenameFile(fileName, e) }
155160
onKeyDown={e => e.keyCode === 13 ? (e.target as HTMLElement).blur() : null }

src/Gistlyn/src/app.js

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gistlyn/src/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)