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

Sidebar #687

Merged
merged 22 commits into from
Mar 1, 2020
Merged
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
2 changes: 1 addition & 1 deletion app/components/editor-mode-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@ember/component';

export default Component.extend({
tagName: 'li',
classNames: ['dropdown'],
classNames: ['dropdown', 'dropup'],

actions: {
setKeyMap(keyMap) {
Expand Down
18 changes: 1 addition & 17 deletions app/components/file-editor-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,19 @@ export default Component.extend({

isFirstColumn: equal('col', '1'),

showFileTreeOpenIcon: computed('isFirstColumn', 'fileTreeShown', function() {
return this.isFirstColumn && !this.fileTreeShown;
}),

focusIn () {
this.focusEditor(this);
},

actions: {
selectFile(file) {
selectAndSetFile(file) {
this.set('file', file);
this.selectFile(file);
},

valueUpdated(value, __, changeObj) {
const isUserChange = changeObj.origin !== 'setValue';
this.contentChanged(isUserChange, value);
},

removeColumn(col) {
this.removeColumn(col);
},

addColumn() {
this.addColumn();
},

showFileTree() {
this.showFileTree();
}
}
});
2 changes: 1 addition & 1 deletion app/components/file-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DropdownSubmenuFixMixin from "../mixins/dropdown-submenu-fix";

export default Component.extend(DropdownSubmenuFixMixin, {
tagName: 'li',
classNames: ['dropdown'],
classNames: ['dropdown', 'dropup'],

// show fork option only if does not belong to user and is not a revision, otherwise show copy
// Github api does not permit forking if you own the gist already
Expand Down
8 changes: 2 additions & 6 deletions app/components/file-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,18 @@ export default Component.extend({
this.jsTreeActionReceiver.send('toggleNode', node.id);
},

didBecomeReady() {
didBecomeReadyOptional() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. Can't believe I wrote this. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We all have these moments :D

if(this.didBecomeReady) {
this.didBecomeReady();
}
},

didChange() {
didChangeOptional() {
if (this.didChange) {
this.didChange();
}
},

hideFileTree() {
this.hideFileTree();
},

expandAll() {
this.jsTreeActionReceiver.send('openAll');
},
Expand Down
1 change: 1 addition & 0 deletions app/components/gist-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { equal } from '@ember/object/computed';
import Component from '@ember/component';

export default Component.extend({
classNames: ['gist-body'],
noColumns: equal('numColumns', 0)
});
8 changes: 8 additions & 0 deletions app/components/gist-header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Component from '@ember/component';

export default Component.extend({
classNames: ['gist-header'],
classNameBindings: ['open'],
tagName: 'nav',
open: true
});
1 change: 1 addition & 0 deletions app/components/twiddle-panes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { run } from '@ember/runloop';
export default Component.extend({
resizeableColumns: service(),
classNames: ['row', 'twiddle-panes'],
classNameBindings: ['fileTreeShown'],

init() {
this._super(...arguments);
Expand Down
2 changes: 1 addition & 1 deletion app/components/user-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import config from '../config/environment';

export default Component.extend({
tagName: 'ul',
classNames: ['nav', 'nav-pills', 'user-menu'],
classNames: ['user-menu', 'dropup'],

userName: readOnly('session.currentUser.login'),

Expand Down
2 changes: 1 addition & 1 deletion app/components/versions-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DropdownSubmenuFixMixin from "../mixins/dropdown-submenu-fix";
export default Component.extend(DropdownSubmenuFixMixin, {
dependencyResolver: service(),
tagName: 'li',
classNames: ['dropdown', 'versions-menu'],
classNames: ['dropdown', 'dropup', 'versions-menu'],

versions: readOnly('dependencyResolver.emberVersions'),
dataVersions: readOnly('dependencyResolver.emberDataVersions')
Expand Down
5 changes: 5 additions & 0 deletions app/helpers/not.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { helper } from '@ember/component/helper';

export default helper(function not([val]/*, hash*/) {
return !val;
});
150 changes: 46 additions & 104 deletions app/styles/_toolbar.scss
Original file line number Diff line number Diff line change
@@ -1,86 +1,44 @@
.toolbar {
display: flex;
flex-direction: column;
color: #fff;
font-size: $font-size;
background: $header-bg;
background-image: url(/images/header.svg);
background-position: top center;
background-repeat: no-repeat;
background-size: cover;

hr {
display: none;
@media (max-width: $screen-md-min) {
padding: 0;
}

@media (min-width: $screen-md-min) {
height: $topbar-height;
}

.nav-pills > li > a {
display: block;
text-decoration: none;
}


@media (min-width: $screen-md-min) {
height: $topbar-height;
.dropdown .caret {
position: absolute;
right: 10px;
top: 13px;
}

@media (max-width: $screen-md-min) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still responsive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that is my next task haha.

position: relative;
z-index: 100;
opacity: 1;

>div, >ul {
margin-top: 0;
margin-bottom: 0;
}

.nav-pills > li {
float: none;
}

.nav-pills > li + li {
margin-left: 0;
}

.dropdown-toggle {
display: block;
border-radius: 0;
box-shadow: none;
}

.dropdown-menu {
position: static;
float: none;
border: 0;
border-radius: 0;
box-shadow: none;
background: inherit;

.dropdown-submenu > .dropdown-menu {
margin-left: 1em;
margin-top: 0;
}

.divider {
background-color: lighten($burnt-orange, 10%);
}

a {
color: #fff;

&:hover {
background-color: lighten($burnt-orange, 10%);
}
}
}

hr {
display: block;
border-color: $burnt-orange;
margin: 1em 0;
.dropdown-menu {
.dropdown-submenu > .dropdown-menu {
top: auto;
margin-bottom: -31px;
}
}
color: #fff;
font-size: $font-size;
background: $header-bg;
background-image: url(/images/header.svg);
background-position: top center;
background-repeat: no-repeat;
background-size: cover;
padding: 1rem 0;

@media (max-width: $screen-md-min) {
padding: 0;
hr {
display: block;
border-color: $burnt-orange;
margin: 1em 0;
}

button.navbar-toggle {
Expand Down Expand Up @@ -109,22 +67,24 @@
padding-left: 0;
}

.user-menu {
text-align: right;
.file-tree {
flex: 1.5;
overflow: auto;

@media (min-width: $screen-md-min) {
position: absolute;
right: 0;
top: ($topbar-height - $topbar-control-height) / 2;
.jstree-default .jstree-hovered {
background: rgba(0, 0, 0, 0.13);
box-shadow: none;
}

@media (max-width: $screen-md-min) {
float: none;
text-align: left;
.jstree-default .jstree-clicked {
background: #b95252;
box-shadow: none;
}
}

.user-dropdown > .dropdown-toggle {
padding-left: 1em;
}
.user-menu {
a {
display: block;
}

.user-avatar {
Expand All @@ -133,7 +93,7 @@
height: 100%;
overflow: hidden;
float: left;
margin-right: 10px;
margin-right: 5px;
line-height: normal;
border-radius: 3px;

Expand All @@ -144,22 +104,16 @@

&.unauthenticated {
background: url("../images/github32-inverse-faf2ee.svg");
height: 32px;
}
}
}

.main-menu {
text-align: left;
height: 60px;

@media (min-width: $screen-md-min) {
position: absolute;
left: 0;
top: ($topbar-height - $topbar-control-height) / 2;
}

@media (max-width: $screen-md-min) {
height: auto;
a {
display: block;
}
}

Expand All @@ -170,18 +124,6 @@
margin-left: auto;
margin-right: auto;

@media (min-width: $screen-md-min) {
position: absolute;
top: 6px;
left: 50%;
margin-left: -400px;
width: 800px;
}

@media (max-width: $screen-md-min) {
margin-left: 15px;
}

h1 {
margin: 10px;
}
Expand Down Expand Up @@ -276,7 +218,7 @@

.sign-in {
cursor: pointer;
padding: 0 .5em 0 0;
padding: 0 .5em;
}

.signing-in {
Expand Down
Loading