Skip to content

Commit

Permalink
Add close button to localNavDropdowns.
Browse files Browse the repository at this point in the history
- Make Timelion docs dropdown scroll only the table.
- Make Timelion tutorial a fluid height, instead of fixed.
  • Loading branch information
cjcenizal committed Dec 10, 2016
1 parent 6e819c1 commit f149a44
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@bigfunger/decompress-zip": "0.2.0-stripfix3",
"@bigfunger/jsondiffpatch": "0.1.38-webpack",
"@elastic/datemath": "2.3.0",
"@elastic/kibana-ui-framework": "0.0.11",
"@elastic/kibana-ui-framework": "0.0.13",
"@spalger/filesaver": "1.1.2",
"@spalger/leaflet-draw": "0.2.3",
"@spalger/leaflet-heat": "0.1.3",
Expand Down
11 changes: 3 additions & 8 deletions src/core_plugins/timelion/public/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ timelion-interval {
display: flex;
}

.timelionFunctionsDropdown {
.timelionFunctionsDropdownContent {
height: 310px;
overflow-y: auto;
}
Expand All @@ -144,27 +144,22 @@ timelion-interval {
}

.doc-container-content {
padding: 0 20px 20px 20px;
height: 310px;
overflow-y: auto;
background-color: @body-bg;
position: relative;
}

.doc-container-buttons {
position: relative;
text-align: center;
background-color: @body-bg;
height: 40px;

.btn-doc-prev {
position: absolute;
left: 20px;
left: 0px;
}

.btn-doc-next {
position: absolute;
right: 20px;
right: 0px;
}
}

Expand Down
66 changes: 34 additions & 32 deletions src/core_plugins/timelion/public/partials/docs/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,44 +145,46 @@ <h2>Data: Transform <small>insert beat boxing</small></h2>
</div>
</div>

<div ng-show="section === 'functions'" class="localDropdown timelionFunctionsDropdown">
<div ng-show="section === 'functions'">
<div class="localDropdownTitle">
Function reference
</div>
<div class="localDropdownHelpText">
Click a function for details and arguments or <a ng-click="section = 'tutorial'">return to the tutorial.</a>
</div>
<table class="table table-condensed table-bordered timelionFunctionsTable">
<tr class="timelionFunctionsTableRow"
ng-repeat-start="function in functions.list"
ng-class="{active: functions.details === function.name}"
ng-click="functions.details = (functions.details === function.name ? null : function.name)">
<td><strong>.{{function.name}}()</strong></td>
<td>{{function.help}}</td>
</tr>
<div class="timelionFunctionsDropdownContent">
<table class="table table-condensed table-bordered timelionFunctionsTable">
<tr class="timelionFunctionsTableRow"
ng-repeat-start="function in functions.list"
ng-class="{active: functions.details === function.name}"
ng-click="functions.details = (functions.details === function.name ? null : function.name)">
<td><strong>.{{function.name}}()</strong></td>
<td>{{function.help}}</td>
</tr>

<!-- Function details -->
<tr ng-if="functions.details === function.name" ng-repeat-end>
<td colspan=2>
<div class="suggestion-details" >
<table class="table table-condensed table-bordered timelionFunctionDetailsTable"
ng-show="function.args.length > (function.chainable ? 1: 0)">
<thead>
<th>Argument Name</th>
<th>Accepted Types</th>
<th>Information</th>
</thead>
<tr ng-repeat="arg in function.args" ng-hide="$index < 1 && function.chainable">
<td>{{arg.name}}</td>
<td><em>{{arg.types.join(', ')}}</em></td>
<td>{{arg.help}}</td>
</tr>
</table>
<div ng-hide="function.args.length > (function.chainable ? 1: 0)">
<em>This function does not accept any arguments. Well that's simple, isn't it?</em>
<!-- Function details -->
<tr ng-if="functions.details === function.name" ng-repeat-end>
<td colspan=2>
<div class="suggestion-details" >
<table class="table table-condensed table-bordered timelionFunctionDetailsTable"
ng-show="function.args.length > (function.chainable ? 1: 0)">
<thead>
<th>Argument Name</th>
<th>Accepted Types</th>
<th>Information</th>
</thead>
<tr ng-repeat="arg in function.args" ng-hide="$index < 1 && function.chainable">
<td>{{arg.name}}</td>
<td><em>{{arg.types.join(', ')}}</em></td>
<td>{{arg.help}}</td>
</tr>
</table>
<div ng-hide="function.args.length > (function.chainable ? 1: 0)">
<em>This function does not accept any arguments. Well that's simple, isn't it?</em>
</div>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
8 changes: 6 additions & 2 deletions src/ui/public/kbn_top_nav/kbn_top_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@
<!-- Dropdown content, e.g. time-picker. -->
<div
class="localDropdown"
id="template_wrapper"
ng-show="kbnTopNav.rendered"
>
<!-- Content gets dynamically inserted here. -->
<button class="localDropdownCloseButton" ng-click="kbnTopNav.close()">
<span class="fa fa-times"></span>
</button>
<div id="template_wrapper">
<!-- Content gets dynamically inserted here. -->
</div>
</div>

<div class="localNavRow localNavRow--secondary">
Expand Down
11 changes: 11 additions & 0 deletions src/ui/public/styles/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -1087,4 +1087,15 @@ fieldset {
.makeKuiColumns(@n, (@i + 1));
}

/**
* 1. Override Bootstrap styles.
*/
.localDropdownCloseButton {
color: #2d2d2d !important; /* 1 */

.theme-dark & {
color: #cecece !important; /* 1 */
}
}

@import "~dragula/dist/dragula.css";

0 comments on commit f149a44

Please sign in to comment.