Merge pull request #1733 from nasa/create-menu-1729

Review and integrate super-menu fixes and enhancements
This commit is contained in:
Victor Woeltjen 2017-09-25 16:29:54 -07:00 committed by GitHub
commit 2baf3f8bb0
11 changed files with 237 additions and 189 deletions

View File

@ -23,7 +23,7 @@
<div class="s-menu-button major create-button" ng-click="createController.toggle()"> <div class="s-menu-button major create-button" ng-click="createController.toggle()">
<span class="title-label">Create</span> <span class="title-label">Create</span>
</div> </div>
<div class="menu super-menu" ng-show="createController.isActive()"> <div class="menu super-menu l-create-menu" ng-show="createController.isActive()">
<mct-representation mct-object="domainObject" key="'create-menu'"> <mct-representation mct-object="domainObject" key="'create-menu'">
</mct-representation> </mct-representation>
</div> </div>

View File

@ -19,8 +19,8 @@
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<div class="contents" ng-controller="CreateMenuController"> <div class="w-menu" ng-controller="CreateMenuController">
<div class="pane left menu-items"> <div class="col menu-items">
<ul> <ul>
<li ng-repeat="createAction in createActions" ng-click="createAction.perform()"> <li ng-repeat="createAction in createActions" ng-click="createAction.perform()">
<a ng-mouseover="representation.activeMetadata = createAction.getMetadata()" <a ng-mouseover="representation.activeMetadata = createAction.getMetadata()"
@ -31,8 +31,9 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="pane right menu-item-description"> <div class="col menu-item-description">
<div class="desc-area icon {{ representation.activeMetadata.cssClass }}"></div> <div class="desc-area icon {{ representation.activeMetadata.cssClass }}"></div>
<div class="w-title-desc">
<div class="desc-area title"> <div class="desc-area title">
{{representation.activeMetadata.name}} {{representation.activeMetadata.name}}
</div> </div>
@ -41,3 +42,4 @@
</div> </div>
</div> </div>
</div> </div>
</div>

View File

@ -753,11 +753,15 @@ body.desktop {
} }
.overlay ::-webkit-scrollbar-thumb { .overlay ::-webkit-scrollbar-thumb {
$lr: 15%;
background: $scrollbarThumbColorOverlay; background: $scrollbarThumbColorOverlay;
&:hover { background: $scrollbarThumbColorOverlayHov; } &:hover { background: $scrollbarThumbColorOverlayHov; }
} }
.menu ::-webkit-scrollbar-thumb {
background: $scrollbarThumbColorMenu;
&:hover { background: $scrollbarThumbColorMenuHov; }
}
::-webkit-scrollbar-corner { ::-webkit-scrollbar-corner {
background: $scrollbarTrackColorBg; background: $scrollbarTrackColorBg;
} }

View File

@ -41,7 +41,8 @@
$d: 10px; $d: 10px;
display: inline-block; display: inline-block;
border: 1px solid rgba($colorBtnFg, 0.2); border: 1px solid rgba($colorBtnFg, 0.2);
height: $d; width: $d; height: $d;
width: $d;
vertical-align: middle; vertical-align: middle;
margin-left: $interiorMarginSm; margin-left: $interiorMarginSm;
margin-top: -2px; margin-top: -2px;
@ -72,17 +73,12 @@
position: relative; position: relative;
} }
.s-menu { .menu {
border-radius: $basicCr; border-radius: $basicCr;
@include containerSubtle($colorMenuBg, $colorMenuFg); @include containerSubtle($colorMenuBg, $colorMenuFg);
@include boxShdw($shdwMenu); @include boxShdw($shdwMenu);
@include txtShdw($shdwMenuText); @include txtShdw($shdwMenuText);
padding: $interiorMarginSm 0; padding: $interiorMarginSm 0;
}
.menu {
// TODO: reduce size of icons
@extend .s-menu;
display: block; display: block;
position: absolute; position: absolute;
z-index: 10; z-index: 10;
@ -92,7 +88,6 @@
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid pullForward($colorMenuBg, 10%); border-top: 1px solid pullForward($colorMenuBg, 10%);
color: $colorMenuFg; color: $colorMenuFg;
//color: pullForward($colorMenuBg, 60%);
line-height: $menuLineH; line-height: $menuLineH;
padding: $interiorMarginSm $interiorMargin * 2 $interiorMarginSm ($interiorMargin * 2) + $treeTypeIconW; padding: $interiorMarginSm $interiorMargin * 2 $interiorMarginSm ($interiorMargin * 2) + $treeTypeIconW;
position: relative; position: relative;
@ -165,27 +160,33 @@
} }
} }
.super-menu { .super-menu,
$w: 500px; .super-menu > mct-representation,
$h: $w - 20; .super-menu > .contents {
$plw: 50%;
$prw: 50%;
display: block;
width: $w;
height: $h;
.contents {
@include absPosDefault($interiorMargin);
}
.pane {
box-sizing: border-box; box-sizing: border-box;
display: block;
position: relative;
}
.super-menu {
$plw: 50%;
$prw: 100% - $plw;
position: absolute;
.w-menu {
align-items: stretch;
display: flex;
flex-direction: row;
margin: $interiorMarginLg;
}
.col {
box-sizing: border-box;
flex: 1 1 auto;
overflow-x: hidden;
&.menu-items { &.menu-items {
border-right: 1px solid pullForward($colorMenuBg, 10%); border-right: 1px solid pullForward($colorMenuBg, 10%);
left: 0;
padding-right: $interiorMargin;
right: auto;
width: $plw;
overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
padding-right: $interiorMargin;
width: $plw;
ul { ul {
li { li {
border-radius: $controlCr; border-radius: $controlCr;
@ -195,22 +196,19 @@
} }
} }
&.menu-item-description { &.menu-item-description {
left: auto; $p: $interiorMargin * 3;
right: 0; overflow-y: hidden;
padding: $interiorMargin * 5; padding: $p $p 0 $p;
width: $prw; width: $prw;
.desc-area { .desc-area {
&.icon { &.icon {
color: $colorCreateMenuLgIcon; color: $colorCreateMenuLgIcon;
font-size: 8em;
margin-bottom: $interiorMargin * 3;
position: relative; position: relative;
text-align: center; text-align: center;
} }
&.title { &.title {
color: $colorCreateMenuText; color: $colorCreateMenuText;
font-size: 1.2em;
margin-bottom: $interiorMargin * 2;
} }
&.description { &.description {
color: pushBack($colorCreateMenuText, 20%); color: pushBack($colorCreateMenuText, 20%);
@ -221,27 +219,63 @@
} }
} }
.w-title-desc {
display: flex;
flex-direction: column;
overflow: hidden; // Height set in specific menu instances
}
// Specific menu instances
&.l-create-menu {
width: 500px;
.col {
max-height: 70vh;
}
.w-title-desc {
height: 190px;
}
.desc-area {
&.icon {
font-size: 8em;
height: 135px;
margin-bottom: $interiorMargin * 3;
}
&.title {
font-size: 1.2em;
margin-bottom: $interiorMargin * 2;
}
}
}
&.mini { &.mini {
width: 400px; width: 400px;
height: 300px; .col {
.pane { max-height: 50vh;
&.menu-items { &.menu-items {
font-size: 0.8em; font-size: 0.8em;
} }
&.menu-item-description { &.menu-item-description {
padding: $interiorMargin * 3; $p: $interiorMargin * 2;
padding: $p $p 0 $p;
}
}
.w-title-desc {
height: 180px;
}
.desc-area { .desc-area {
&.icon { &.icon {
font-size: 4em; font-size: 4em;
height: 70px;
margin-bottom: $interiorMargin * 3;
} }
&.title { &.title {
font-size: 1em; font-size: 1em;
margin-bottom: $interiorMargin * 2;
} }
} }
} }
} }
}
}
.context-menu { .context-menu {
font-size: 0.80rem; font-size: 0.80rem;
} }
@ -280,5 +314,6 @@
} }
.menus-up .menu { .menus-up .menu {
bottom: $btnStdH; top: auto; bottom: $btnStdH;
top: auto;
} }

View File

@ -156,6 +156,8 @@
left: 0; left: 0;
right: 0; right: 0;
overflow: auto; overflow: auto;
padding-right: $interiorMargin;
padding-bottom: $interiorMargin;
.field.l-input-med { .field.l-input-med {
input[type='text'] { input[type='text'] {
width: 100%; width: 100%;

View File

@ -201,13 +201,15 @@ $shdwItemTreeIcon: 0.6;
$colorThumbHoverBg: $colorItemTreeHoverBg; $colorThumbHoverBg: $colorItemTreeHoverBg;
// Scrollbar // Scrollbar
$scrollbarTrackSize: 10px; $scrollbarTrackSize: 7px;
$scrollbarTrackShdw: rgba(#000, 0.7) 0 1px 5px; $scrollbarTrackShdw: rgba(#000, 0.5) 0 1px 5px;
$scrollbarTrackColorBg: rgba(#000, 0.4); $scrollbarTrackColorBg: transparent; //rgba(#000, 0.4);
$scrollbarThumbColor: pullForward($colorBodyBg, 10%); $scrollbarThumbColor: pullForward($colorBodyBg, 10%);
$scrollbarThumbColorHov: pullForward($scrollbarThumbColor, 2%); $scrollbarThumbColorHov: pullForward($scrollbarThumbColor, 2%);
$scrollbarThumbColorOverlay: pullForward($colorOvrBg, 10%); $scrollbarThumbColorOverlay: pullForward($colorOvrBg, 10%);
$scrollbarThumbColorOverlayHov: pullForward($scrollbarThumbColorOverlay, 2%); $scrollbarThumbColorOverlayHov: pullForward($scrollbarThumbColorOverlay, 2%);
$scrollbarThumbColorMenu: pullForward($colorMenuBg, 20%);
$scrollbarThumbColorMenuHov: pullForward($scrollbarThumbColorMenu, 2%);
// Splitter // Splitter
// All splitterD* values MUST both be either odd or even numbers // All splitterD* values MUST both be either odd or even numbers

View File

@ -201,13 +201,15 @@ $shdwItemTreeIcon: none;
$colorThumbHoverBg: $colorItemTreeHoverBg; $colorThumbHoverBg: $colorItemTreeHoverBg;
// Scrollbar // Scrollbar
$scrollbarTrackSize: 10px; $scrollbarTrackSize: 7px;
$scrollbarTrackShdw: rgba(#000, 0.2) 0 1px 2px; $scrollbarTrackShdw: rgba(#000, 0.2) 0 1px 2px;
$scrollbarTrackColorBg: rgba(#000, 0.2); $scrollbarTrackColorBg: rgba(#000, 0.2);
$scrollbarThumbColor: darken($colorBodyBg, 50%); $scrollbarThumbColor: darken($colorBodyBg, 50%);
$scrollbarThumbColorHov: $colorKey; $scrollbarThumbColorHov: $colorKey;
$scrollbarThumbColorOverlay: darken($colorOvrBg, 50%); $scrollbarThumbColorOverlay: darken($colorOvrBg, 50%);
$scrollbarThumbColorOverlayHov: $scrollbarThumbColorHov; $scrollbarThumbColorOverlayHov: $scrollbarThumbColorHov;
$scrollbarThumbColorMenu: pullForward($colorMenuBg, 10%);
$scrollbarThumbColorMenuHov: pullForward($scrollbarThumbColorMenu, 2%);
// Splitter // Splitter
// All splitterD* values MUST both be either odd or even numbers // All splitterD* values MUST both be either odd or even numbers

View File

@ -19,8 +19,8 @@
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<div class="contents"> <div class="w-menu">
<div class="pane left menu-items"> <div class="col menu-items">
<ul> <ul>
<li ng-repeat="metadata in ngModel.options" <li ng-repeat="metadata in ngModel.options"
ng-click="ngModel.select(metadata)"> ng-click="ngModel.select(metadata)">
@ -32,8 +32,9 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="pane right menu-item-description"> <div class="col menu-item-description">
<div class="desc-area ui-symbol icon type-icon {{ngModel.activeMetadata.cssClass}}"></div> <div class="desc-area ui-symbol icon type-icon {{ngModel.activeMetadata.cssClass}}"></div>
<div class="w-title-desc">
<div class="desc-area title"> <div class="desc-area title">
{{ngModel.activeMetadata.name}} {{ngModel.activeMetadata.name}}
</div> </div>
@ -42,3 +43,4 @@
</div> </div>
</div> </div>
</div> </div>
</div>

View File

@ -24,7 +24,7 @@
ng-click="modeController.toggle()"> ng-click="modeController.toggle()">
<span class="title-label">{{ngModel.selected.name}}</span> <span class="title-label">{{ngModel.selected.name}}</span>
</div> </div>
<div class="menu super-menu mini mode-selector-menu" <div class="menu super-menu mini l-mode-selector-menu"
ng-show="modeController.isActive()"> ng-show="modeController.isActive()">
<mct-include key="'mode-menu'" <mct-include key="'mode-menu'"
ng-model="ngModel"> ng-model="ngModel">

View File

@ -201,7 +201,7 @@ define(
var options = [{ var options = [{
key: 'fixed', key: 'fixed',
name: 'Fixed Timespan Mode', name: 'Fixed Timespan Mode',
description: 'Query and explore data that falls between two fixed datetimes', description: 'Query and explore data that falls between two fixed datetimes.',
cssClass: 'icon-calendar' cssClass: 'icon-calendar'
}]; }];
var clocks = {}; var clocks = {};

View File

@ -37,8 +37,7 @@ define(['EventEmitter'], function (EventEmitter) {
this.key = 'local'; this.key = 'local';
this.cssClass = 'icon-clock'; this.cssClass = 'icon-clock';
this.name = 'Local Clock'; this.name = 'Local Clock';
this.description = "Updates every second, providing UTC timestamps from " + this.description = "Provides UTC timestamps every second from the local system clock.";
"user's local computer.";
this.period = period; this.period = period;
this.timeoutHandle = undefined; this.timeoutHandle = undefined;