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

[FEATURE] Support mobile devices #176

Merged
merged 19 commits into from
Aug 1, 2016
Merged
Show file tree
Hide file tree
Changes from 12 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
5 changes: 4 additions & 1 deletion public/app/components/fileTree/fileTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ angular.module('kibibitCodeEditor')
bindToController: {
path: '=kbFileTreePath',
selection: '=kbFileTreeSelection',
userOptions: '=kbFileTreeOptions'
userOptions: '=kbFileTreeOptions',
onFileSelection: '&kbOnFileSelection'
},
controller: 'fileTreeController',
controllerAs: 'fileTreeCtrl',
Expand Down Expand Up @@ -71,11 +72,13 @@ angular.module('kibibitCodeEditor')

if (vm.options.selectionMode == 'folder') {
vm.selection = folder.path;
vm.onFileSelection();
}
} else {
file = treeNode;
if (vm.options.selectionMode == 'file') {
vm.selection = file.path;
vm.onFileSelection();
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions public/app/components/menuBar/menuBarTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<div>
<h2 class="md-toolbar-tools">{{main.projectFolderPath}}</h2>
<md-menu-bar>
<button class="hamburger" ng-click="main.isSidebarOpen = !main.isSidebarOpen">
<i class="material-icons">menu</i>
</button>
<md-menu>
<button ng-click="$mdOpenMenu()">
File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="buttons">
<button
class="btn"
ng-click="closeThisDialog(ngDialogData.selectedProjectFolder)">
ng-click="closeThisDialog(ngDialogData.selectedProjectFolder); main.isSidebarOpen = true;">
Select
</button>
<button class="btn" ng-click="closeThisDialog(0)">Close</button>
Expand Down
1 change: 1 addition & 0 deletions public/app/controllers/mainCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ angular.module('kibibitCodeEditor')

vm.openFile = '';
vm.openProject = {};
vm.isSidebarOpen = false;

vm.settings = SettingsService.settings;

Expand Down
36 changes: 23 additions & 13 deletions public/app/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kibibit Code Editor</title>
<!-- FOR ANGULAR ROUTING -->
<base href="/">
Expand Down Expand Up @@ -36,21 +37,30 @@
<div ui-layout-container size="104px" class="menu-bar-container">
<kb-menu-bar></kb-menu-bar>
</div>

<div ui-layout-container="central" style="z-index: 6;">
<div class="mobile-sidebar" ng-class="{'open': main.isSidebarOpen}" ng-scrollbars>
<kb-file-tree
kb-file-tree-path="main.projectFolderPath"
kb-file-tree-selection="main.openFile"
kb-on-file-selection="main.isSidebarOpen = false;">
</kb-file-tree>
<button class="close" ng-click="main.isSidebarOpen = !main.isSidebarOpen">
<i class="material-icons">close</i>
</button>
</div>
<div ui-layout-container="central" class="main-area" style="z-index: 6;">
<div ui-layout="{ flow : 'column', dividerSize: '10' }">
<div ui-layout-container class="sidebar-container" size="20%">
<div class="sidebar" ng-scrollbars>
<kb-file-tree
kb-file-tree-path="main.projectFolderPath"
kb-file-tree-selection="main.openFile">
</kb-file-tree>
<div ui-layout-container class="sidebar-container" size="20%">
<div class="sidebar" ng-scrollbars>
<kb-file-tree
kb-file-tree-path="main.projectFolderPath"
kb-file-tree-selection="main.openFile">
</kb-file-tree>
</div>
</div>
<div ui-layout-container class="main-view-container">
<div class="tabs"></div>
<div class="main-view" ng-view></div>
</div>
</div>
<div ui-layout-container class="main-view-container">
<div class="tabs"></div>
<div class="main-view" ng-view></div>
</div>
</div>
</div>
<div ui-layout-container size="30px" class="status-bar">
Expand Down
17 changes: 17 additions & 0 deletions public/assets/sass/_components/_menuBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,27 @@
// scss-lint:disable SelectorDepth
// scss-lint:disable ColorVariable
kb-menu-bar {
@include phone {
md-menu-bar {
padding: 0;
}
}

.project-logo-container {
height: 105px;
width: 105px;

@include phone {
height: 46px;
margin-left: 7px;
width: 46px;

.logo {
margin-top: 11px;
zoom: 47%;
}
}

.logo {
align-items: center;
background-color: rgba(0, 0, 0, 0.3);
Expand Down
4 changes: 4 additions & 0 deletions public/assets/sass/_components/_searchProject.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ kb-search-project {
padding: 0;
position: relative;

@include phone {
display: none;
}

.search-btn {
background-color: transparent;
border: 0;
Expand Down
87 changes: 86 additions & 1 deletion public/assets/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ $color1: rgb(70, 70, 70);
$color2: #808080;
$color3: rgb(38, 38, 38);

$tablet-width: 768px;
$desktop-width: 1024px;

@mixin phone {
@media (max-width: #{$tablet-width - 1px}) {
@content;
}
}

.main-app-container {
opacity: 0;
transition: opacity 0.5s ease;
Expand Down Expand Up @@ -95,6 +104,18 @@ body,
.menu-bar-container {
background: $color1;
overflow: hidden;

@include phone {
height: 48px !important;

Choose a reason for hiding this comment

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

!important should not be used

overflow: hidden;
}
}

@include phone {
.main-area {
height: calc(100vh - 52px - 30px) !important;

Choose a reason for hiding this comment

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

!important should not be used

top: 52px !important;

Choose a reason for hiding this comment

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

!important should not be used

}
}

.main-view-container {
Expand All @@ -104,6 +125,64 @@ body,
flex-direction: column;
flex-wrap: nowrap;
overflow: hidden;

@include phone {
// scss-lint:disable ImportantRule
border-left: 10px solid $color1;
bottom: 0;
left: 0 !important;

Choose a reason for hiding this comment

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

!important should not be used

Choose a reason for hiding this comment

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

!important should not be used

position: absolute;
right: 0;
top: 0;
width: 100% !important;

Choose a reason for hiding this comment

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

!important should not be used

Choose a reason for hiding this comment

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

!important should not be used

z-index: 90;
// scss-lint:enable ImportantRule
}
}

.hamburger {
display: none;

Choose a reason for hiding this comment

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

Properties should be ordered color, display, fill


@include phone {
display: inline-block;
position: relative;
top: 9px;
}
}

.mobile-sidebar {
display: none;

Choose a reason for hiding this comment

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

Properties should be ordered color, display

color: $primary;

@include phone {
background: $color1;
bottom: 0;
display: block;

Choose a reason for hiding this comment

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

Properties should be ordered background, bottom, display, left, position, top, transform, transition, width, z-index

height: 100vh;
left: 0;
position: absolute;
top: 0;
transform: translateX(-150vw);
transition: transform ease-in-out 250ms;
width: 100vw;
z-index: 91;

&.open {
transform: none;
}

.tree-container {
padding: 24px;
}

.close {
color: $primary;
padding: 5px;
position: fixed;
right: 10px;
top: 10px;
}
}
}

.tabs {
Expand All @@ -126,6 +205,10 @@ md-toolbar {
h2 {
&.md-toolbar-tools {
color: $primary;

@include phone {
display: none;
}
}
}
}
Expand Down Expand Up @@ -182,11 +265,12 @@ treecontrol {

&.ngdialog-theme-default .ngdialog-content {
bottom: 0;
left: calc(50vw - 225px);
left: 0;
margin: auto;
max-height: 600px;
overflow: hidden;
position: absolute;
right: 0;
top: 0;
z-index: 10;

Expand Down Expand Up @@ -292,3 +376,4 @@ md-input-container {
// scss-lint:enable IdSelector
// scss-lint:enable NestingDepth
// scss-lint:enable SelectorDepth