Merge pull request #75 from standardnotes/flexbox

Flexbox
This commit is contained in:
Mo Bitar
2017-02-16 17:23:51 -06:00
committed by GitHub
14 changed files with 208 additions and 296 deletions

View File

@@ -46,8 +46,8 @@ angular.module('app.frontend')
}) })
.controller('EditorCtrl', function ($sce, $timeout, authManager, $rootScope, extensionManager, syncManager, modelManager) { .controller('EditorCtrl', function ($sce, $timeout, authManager, $rootScope, extensionManager, syncManager, modelManager) {
window.addEventListener("message", function(){ window.addEventListener("message", function(event){
console.log("App received message:", event); // console.log("App received message:", event);
if(event.data.status) { if(event.data.status) {
this.postNoteToExternalEditor(); this.postNoteToExternalEditor();
} else { } else {

View File

@@ -1,7 +1,5 @@
angular.module('app.frontend') angular.module('app.frontend')
.controller('HomeCtrl', function ($scope, $rootScope, $timeout, modelManager, syncManager, authManager) { .controller('HomeCtrl', function ($scope, $rootScope, $timeout, modelManager, syncManager, authManager) {
$rootScope.bodyClass = "app-body-class";
syncManager.loadLocalItems(function(items) { syncManager.loadLocalItems(function(items) {
$scope.$apply(); $scope.$apply();

View File

@@ -72,45 +72,3 @@
} }
} }
} }
.section-menu {
padding-top: 0px;
width: 100%;
position: absolute;
padding-left: inherit;
padding-right: inherit;
left: 0;
right: 0;
bottom: 0px;
background-color: #f1f1f1;
color: $selected-text-color;
height: 28px;
cursor: default;
ol, ul {
margin-top: 5px;
margin-bottom: 10px;
&.dropdown-menu {
margin-top: 10px;
}
}
ul {
li {
text-align: left;
&.sep {
margin: 6px;
display: block;
}
a {
font-size: 13px;
font-weight: bold;
padding: 0 0;
}
}
}
}

View File

@@ -1,5 +1,10 @@
$heading-height: 75px;
.editor { .editor {
width: 60%; flex: 1 50%;
min-width: 300px;
display: flex;
flex-direction: column;
overflow-y: hidden;
&.fullscreen { &.fullscreen {
width: 100%; width: 100%;
@@ -12,26 +17,17 @@
.section-title-bar { .section-title-bar {
border-bottom: none !important; border-bottom: none !important;
height: $heading-height !important;
// &.fullscreen {
// opacity: 0.0;
// -webkit-transition: all 300ms ease-in-out;
// -moz-transition: all 300ms ease-in-out;
// -ms-transition: all 300ms ease-in-out;
// -o-transition: all 300ms ease-in-out;
// transition: all 300ms ease-in-out;
//
// &:hover {
// opacity: 1.0;
// }
}
} }
$heading-height: 100px; .section-menu {
flex: 1 0 28px;
max-height: 28px;
}
}
.editor-heading { .editor-heading {
position: absolute;
width: 100%; width: 100%;
padding: 15px; padding: 15px;
padding-top: 0px; padding-top: 0px;
@@ -39,7 +35,6 @@
min-height: $heading-height; min-height: $heading-height;
width: 100%;
padding-right: 10px; padding-right: 10px;
&.fullscreen { &.fullscreen {
@@ -67,6 +62,7 @@
} }
} }
.save-status { .save-status {
width: 20% !important; width: 20% !important;
float: right; float: right;
@@ -96,31 +92,32 @@
} }
.editor-content { .editor-content {
max-height: 100%; flex: 1;
height: 100%;
clear: both;
min-width: 0;
padding-left: 10px;
padding-right: 10px;
overflow: auto;
text-align: center; // centers children div horizontally
z-index: 10; z-index: 10;
padding-top: $heading-height; overflow-y: hidden;
height: 100%;
display: flex;
background-color: white;
&.fullscreen { &.fullscreen {
padding-top: 0px; padding-top: 0px;
} }
#editor-iframe {
flex: 1;
width: 100%;
}
.editable { .editable {
font-family: monospace; font-family: monospace;
max-height: 100%; flex: 1;
height: 100%; overflow-y: scroll;
width: 100%; width: 100%;
border: none; border: none;
outline: none; outline: none;
padding: 15px; padding: 15px;
padding-top: 17px; padding-top: 11px;
font-size: 17px; font-size: 17px;
resize: none; resize: none;
@@ -132,67 +129,18 @@
} }
} }
.nav-tabs {
a {
color: black;
text-decoration: none;
}
a {
background-color: transparent;
}
}
.nav { .nav {
padding-left: 0; padding-left: 0;
margin-bottom: 0; margin-bottom: 0;
list-style: none; list-style: none;
ul {
font-weight: bold;
}
} }
.nav-pills>li {
float: left;
}
.nav>li {
position: relative;
display: block;
}
.nav-pills>li.active>a, .nav-pills>li.active>a:focus, .nav-pills>li.active>a:hover {
color: #fff;
background-color: #337ab7;
}
.nav-pills>li>a {
border-radius: 4px;
}
.nav>li>a { .nav>li>a {
position: relative; position: relative;
display: block; display: block;
padding: 10px 15px; font-weight: bold;
} user-select: none;
.nav-tabs>li {
float: left;
margin-bottom: -1px;
}
.nav>li {
position: relative;
display: block;
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
color: black;
cursor: pointer;
background-color: #fff;
border: 1px solid #ddd;
border-bottom-color: transparent;
}
.nav-tabs>li>a {
margin-right: 2px;
line-height: 1.42857143;
border: 1px solid transparent;
// border-radius: 4px 4px 0 0;
cursor: pointer;
}
.nav>li>a {
position: relative;
display: block;
padding: 10px 15px;
} }

View File

@@ -42,6 +42,7 @@
> .title { > .title {
font-size: 14px; font-size: 14px;
font-weight: bold;
} }
> .subtitle { > .subtitle {

View File

@@ -45,6 +45,7 @@ body {
height: 100%; height: 100%;
font-size: 20px; font-size: 20px;
margin: 0; margin: 0;
background-color: $bg-color;
} }
.dark-button { .dark-button {
@@ -80,35 +81,21 @@ p {
min-height: 100vh; min-height: 100vh;
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
}
.app-body-class {
height: 100%;
background-color: $bg-color; background-color: $bg-color;
min-width: 100px;
min-width: 900px;
} }
$header-height: 25px; $header-height: 25px;
.app-container {
display: table;
background-color: $bg-color;
width: 100%;
height: calc(100% - #{$header-height});
padding-top: 0px;
font-size: 0;
margin-top: 0;
}
$section-header-height: 70px; $section-header-height: 70px;
.app { .app {
height: 100%; // height: 100%;
height: calc(100% - #{$header-height});
width: 100%; width: 100%;
display: table-row; display: flex;
vertical-align: top; vertical-align: top;
overflow: hidden; overflow: hidden;
position: relative;
.light-button { .light-button {
background-color: $bg-color; background-color: $bg-color;
@@ -127,15 +114,8 @@ $section-header-height: 70px;
.section { .section {
padding-bottom: 0px; padding-bottom: 0px;
display: block;
height: 100%; height: 100%;
max-height: calc(100vh - #{$header-height}); max-height: calc(100vh - #{$header-height});
float: left;
overflow-y: auto;
overflow-x: hidden;
min-width: 0;
font-size: 17px; font-size: 17px;
.scrollable { .scrollable {
@@ -148,7 +128,6 @@ $section-header-height: 70px;
max-height: 100%; max-height: 100%;
background-color: white; background-color: white;
position: relative; position: relative;
box-shadow: 0px 0px 2px rgba(gray, 0.3);
} }
.section-title-bar { .section-title-bar {
@@ -185,3 +164,41 @@ $section-header-height: 70px;
} }
} }
} }
.section-menu {
width: 100%;
padding-top: 0px;
padding-left: 21px;
padding-right: 21px;
background-color: #f1f1f1;
color: $selected-text-color;
height: 28px;
cursor: default;
ol, ul {
margin-top: 5px;
margin-bottom: 10px;
&.dropdown-menu {
margin-top: 10px;
}
}
ul {
li {
text-align: left;
&.sep {
margin: 6px;
display: block;
}
a {
font-size: 13px;
font-weight: bold;
padding: 0 0;
}
}
}
}

View File

@@ -1,8 +1,11 @@
.notes { .notes {
width: 25%;
border-left: 1px solid #dddddd; border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd; border-right: 1px solid #dddddd;
flex: 1 20%;
max-width: 350px;
min-width: 170px;
$notes-title-bar-height: 130px; $notes-title-bar-height: 130px;
.notes-title-bar { .notes-title-bar {

View File

@@ -1,5 +1,8 @@
.tags { .tags {
width: 15%; // width: 15%;
flex: 1 10%;
max-width: 180px;
min-width: 100px;
$tags-title-bar-height: 55px; $tags-title-bar-height: 55px;

View File

@@ -1,5 +1,4 @@
.section.editor{"ng-class" => "{'fullscreen' : ctrl.fullscreen}"} .section.editor{"ng-class" => "{'fullscreen' : ctrl.fullscreen}"}
.content
.section-title-bar.editor-heading{"ng-class" => "{'fullscreen' : ctrl.fullscreen }"} .section-title-bar.editor-heading{"ng-class" => "{'fullscreen' : ctrl.fullscreen }"}
.title .title
%input.input#note-title-editor{"ng-model" => "ctrl.note.title", "ng-keyup" => "$event.keyCode == 13 && ctrl.saveTitle($event)", %input.input#note-title-editor{"ng-model" => "ctrl.note.title", "ng-keyup" => "$event.keyCode == 13 && ctrl.saveTitle($event)",
@@ -10,8 +9,8 @@
%input.tags-input{"type" => "text", "ng-keyup" => "$event.keyCode == 13 && ctrl.updateTagsFromTagsString($event, ctrl.tagsString)", %input.tags-input{"type" => "text", "ng-keyup" => "$event.keyCode == 13 && ctrl.updateTagsFromTagsString($event, ctrl.tagsString)",
"ng-model" => "ctrl.tagsString", "placeholder" => "#tags", "ng-blur" => "ctrl.updateTagsFromTagsString($event, ctrl.tagsString)"} "ng-model" => "ctrl.tagsString", "placeholder" => "#tags", "ng-blur" => "ctrl.updateTagsFromTagsString($event, ctrl.tagsString)"}
.section-menu .section-menu
%ul.nav.nav-pills %ul.nav
%li.dropdown{"click-outside" => "ctrl.showMenu = false;", "is-open" => "ctrl.showMenu"} %li.dropdown.pull-left.mr-10{"click-outside" => "ctrl.showMenu = false;", "is-open" => "ctrl.showMenu"}
%a.dropdown-toggle{"ng-click" => "ctrl.showMenu = !ctrl.showMenu; ctrl.showExtensions = false;"} %a.dropdown-toggle{"ng-click" => "ctrl.showMenu = !ctrl.showMenu; ctrl.showExtensions = false;"}
File File
%span.caret %span.caret
@@ -25,7 +24,7 @@
.text Delete .text Delete
%li.sep %li.sep
%li.dropdown{"click-outside" => "ctrl.showEditorMenu = false;", "is-open" => "ctrl.showEditorMenu"} %li.dropdown.pull-left.mr-10{"click-outside" => "ctrl.showEditorMenu = false;", "is-open" => "ctrl.showEditorMenu"}
%a.dropdown-toggle{"ng-click" => "ctrl.showEditorMenu = !ctrl.showEditorMenu; ctrl.showMenu = false;"} %a.dropdown-toggle{"ng-click" => "ctrl.showEditorMenu = !ctrl.showEditorMenu; ctrl.showMenu = false;"}
Editor Editor
%span.caret %span.caret
@@ -33,7 +32,7 @@
%editor-menu{"ng-if" => "ctrl.showEditorMenu", "callback" => "ctrl.selectedEditor", "selected-editor" => "ctrl.customEditor"} %editor-menu{"ng-if" => "ctrl.showEditorMenu", "callback" => "ctrl.selectedEditor", "selected-editor" => "ctrl.customEditor"}
%li.sep %li.sep
%li.dropdown{"ng-if" => "ctrl.hasAvailableExtensions()", "click-outside" => "ctrl.showExtensions = false;", "is-open" => "ctrl.showExtensions"} %li.dropdown.pull-left{"ng-if" => "ctrl.hasAvailableExtensions()", "click-outside" => "ctrl.showExtensions = false;", "is-open" => "ctrl.showExtensions"}
%a.dropdown-toggle{"ng-click" => "ctrl.showExtensions = !ctrl.showExtensions; ctrl.showMenu = false;"} %a.dropdown-toggle{"ng-click" => "ctrl.showExtensions = !ctrl.showExtensions; ctrl.showMenu = false;"}
Extensions Extensions
%span.caret %span.caret
@@ -41,6 +40,6 @@
%contextual-extensions-menu{"ng-if" => "ctrl.showExtensions", "item" => "ctrl.note"} %contextual-extensions-menu{"ng-if" => "ctrl.showExtensions", "item" => "ctrl.note"}
.editor-content{"ng-class" => "{'fullscreen' : ctrl.fullscreen }"} .editor-content{"ng-class" => "{'fullscreen' : ctrl.fullscreen }"}
%iframe#editor-iframe{"ng-if" => "ctrl.customEditor", "ng-src" => "{{ctrl.customEditor.url | trusted}}", "frameBorder" => "0", "style" => "width: 100%; height: 100%; z-index: 1000; float: left;"} %iframe#editor-iframe{"ng-if" => "ctrl.customEditor", "ng-src" => "{{ctrl.customEditor.url | trusted}}", "frameBorder" => "0", "style" => "width: 100%;"}
%textarea.editable#note-text-editor{"ng-if" => "!ctrl.customEditor", "ng-class" => "{'fullscreen' : ctrl.fullscreen }", "ng-model" => "ctrl.note.text", %textarea.editable#note-text-editor{"ng-if" => "!ctrl.customEditor", "ng-class" => "{'fullscreen' : ctrl.fullscreen }", "ng-model" => "ctrl.note.text",
"ng-change" => "ctrl.contentChanged()", "ng-click" => "ctrl.clickedTextArea()", "ng-focus" => "ctrl.onContentFocus()"} "ng-change" => "ctrl.contentChanged()", "ng-click" => "ctrl.clickedTextArea()", "ng-focus" => "ctrl.onContentFocus()"}

View File

@@ -1,5 +1,4 @@
.main-ui-view .main-ui-view
.app-container
.app .app
%tags-section{"save" => "tagsSave", "add-new" => "tagsAddNew", "will-select" => "tagsWillMakeSelection", "selection-made" => "tagsSelectionMade", "all-tag" => "allTag", %tags-section{"save" => "tagsSave", "add-new" => "tagsAddNew", "will-select" => "tagsWillMakeSelection", "selection-made" => "tagsSelectionMade", "all-tag" => "allTag",
"tags" => "tags"} "tags" => "tags"}

View File

@@ -1,6 +0,0 @@
.about.animated.fadeIn
.title About
.summary Namewhale helps you find a unique name for your startup. Using an intelligent, seed-based algorithm, names are generated based on the sound, style, and feel of the seed words you chose.
.links
%a{"href" => "https://itunes.apple.com/us/app/namewhale/id1028881375?ls=1&mt=8", "target" => "_blank"} Namewhale on the AppStore
%a{"href" => "https://twitter.com/namewhale", "target" => "_blank"} @namewhale

View File

@@ -1,4 +0,0 @@
%footer.footer{"ng-class" => "footerClass"}
.container
.row
.footer-about-section

View File

@@ -37,7 +37,7 @@
</head> </head>
<body ng-class="bodyClass"> <body>
<div ui-view="content"></div> <div ui-view="content"></div>
</body> </body>

View File

@@ -13,10 +13,6 @@ describe("app.frontend", function() {
}); });
})); }));
it('should have a body class', function() {
expect(scope.bodyClass).toEqual('app-body-class');
});
it('should have an All tag', function() { it('should have an All tag', function() {
expect(scope.allTag).toBeDefined(); expect(scope.allTag).toBeDefined();
expect(scope.allTag.title).toEqual("All"); expect(scope.allTag.title).toEqual("All");