Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky side buttons #397

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions src/containers/views/DataFileEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,29 +183,31 @@ export class DataFileEdit extends Component {

return (
<div className="content-side">
<Button
onClick={this.handleClickSave}
type="save"
active={activator}
triggered={updated}
icon="save"
block />
{
guiSupport &&
<Button
onClick={this.toggleView}
type="view-toggle"
active={true}
triggered={this.state.guiView}
block />
}
<Splitter />
<Button
onClick={() => this.handleClickDelete(filename)}
type="delete"
active={true}
icon="trash"
block />
<div className="sticky">
<Button
onClick={this.handleClickSave}
type="save"
active={activator}
triggered={updated}
icon="save"
block />
{
guiSupport &&
<Button
onClick={this.toggleView}
type="view-toggle"
active={true}
triggered={this.state.guiView}
block />
}
<Splitter />
<Button
onClick={() => this.handleClickDelete(filename)}
type="delete"
active={true}
icon="trash"
block />
</div>
</div>
);
}
Expand Down
28 changes: 15 additions & 13 deletions src/containers/views/DataFileNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,21 @@ export class DataFileNew extends Component {
</div>

<div className="content-side">
<Button
onClick={this.handleClickSave}
type="create"
active={activator}
triggered={updated}
icon="plus-square"
block />
<Button
onClick={this.toggleView}
type="view-toggle"
active={true}
triggered={this.state.guiView}
block />
<div className="sticky">
<Button
onClick={this.handleClickSave}
type="create"
active={activator}
triggered={updated}
icon="plus-square"
block />
<Button
onClick={this.toggleView}
type="view-toggle"
active={true}
triggered={this.state.guiView}
block />
</div>
</div>
</div>
</HotKeys>
Expand Down
48 changes: 25 additions & 23 deletions src/containers/views/DocumentEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,29 +147,31 @@ export class DocumentEdit extends Component {
</div>

<div className="content-side">
<Button
onClick={this.handleClickSave}
type="save"
active={fieldChanged}
triggered={updated}
icon="save"
block />
{
http_url &&
<Button
to={http_url}
type="view"
icon="eye"
active={true}
block />
}
<Splitter />
<Button
onClick={() => this.handleClickDelete()}
type="delete"
active={true}
icon="trash"
block />
<div className="sticky">
<Button
onClick={this.handleClickSave}
type="save"
active={fieldChanged}
triggered={updated}
icon="save"
block />
{
http_url &&
<Button
to={http_url}
type="view"
icon="eye"
active={true}
block />
}
<Splitter />
<Button
onClick={() => this.handleClickDelete()}
type="delete"
active={true}
icon="trash"
block />
</div>
</div>
</div>
</HotKeys>
Expand Down
16 changes: 9 additions & 7 deletions src/containers/views/DocumentNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ export class DocumentNew extends Component {
</div>

<div className="content-side">
<Button
onClick={this.handleClickSave}
type="create"
active={fieldChanged}
triggered={updated}
icon="plus-square"
block />
<div className="sticky">
<Button
onClick={this.handleClickSave}
type="create"
active={fieldChanged}
triggered={updated}
icon="plus-square"
block />
</div>
</div>
</div>
</HotKeys>
Expand Down
42 changes: 22 additions & 20 deletions src/containers/views/PageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,28 @@ export class PageEdit extends Component {
</div>

<div className="content-side">
<Button
onClick={this.handleClickSave}
type="save"
active={fieldChanged}
triggered={updated}
icon="save"
block />
<Button
to={http_url}
type="view"
icon="eye"
active={true}
block />
<Splitter />
<Button
onClick={() => this.handleClickDelete(name)}
type="delete"
active={true}
icon="trash"
block />
<div className="sticky">
<Button
onClick={this.handleClickSave}
type="save"
active={fieldChanged}
triggered={updated}
icon="save"
block />
<Button
to={http_url}
type="view"
icon="eye"
active={true}
block />
<Splitter />
<Button
onClick={() => this.handleClickDelete(name)}
type="delete"
active={true}
icon="trash"
block />
</div>
</div>
</div>
</HotKeys>
Expand Down
16 changes: 9 additions & 7 deletions src/containers/views/PageNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ export class PageNew extends Component {
</div>

<div className="content-side">
<Button
onClick={this.handleClickSave}
type="create"
active={fieldChanged}
triggered={updated}
icon="plus-square"
block />
<div className="sticky">
<Button
onClick={this.handleClickSave}
type="create"
active={fieldChanged}
triggered={updated}
icon="plus-square"
block />
</div>
</div>
</div>
</HotKeys>
Expand Down
1 change: 1 addition & 0 deletions src/styles/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
}
}
.content-side {
position: relative;
width: $content-side-width;
margin-left: 40px;
font-size: 16px;
Expand Down
5 changes: 5 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ div:focus {
}
}

.sticky {
position: sticky;
top: 0;
}

@font-face {
font-family: "lato";
src: url(../assets/fonts/lato-regular.ttf);
Expand Down