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

Add delete button to kuiSideBarCollapsibleTitle component. #2

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
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<div>
<button
class="kuiSideBarCollapsibleTitle"
aria-label="Open Editor"
ng-click="isCategoryAxisOpen = !isCategoryAxisOpen"
type="button"
>
<span
aria-hidden="true"
ng-class="{ 'fa-caret-down': isCategoryAxisOpen, 'fa-caret-right': !isCategoryAxisOpen }"
class="fa fa-caret-right kuiSideBarCollapsibleTitle__caret"
></span>
<span class="kuiSideBarCollapsibleTitle__text">
Category Axis
</span>
</button>
<div class="kuiSideBarCollapsibleTitle">
<div
class="kuiSideBarCollapsibleTitle__label"
ng-click="isCategoryAxisOpen = !isCategoryAxisOpen"
>
<span
aria-hidden="true"
ng-class="{ 'fa-caret-down': isCategoryAxisOpen, 'fa-caret-right': !isCategoryAxisOpen }"
class="fa fa-caret-right kuiSideBarCollapsibleTitle__caret"
></span>
<span class="kuiSideBarCollapsibleTitle__text">
Category Axis
</span>
</div>
</div>

<div ng-show="isCategoryAxisOpen" class="kuiSideBarCollapsibleSection">
<!-- General -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
ng-repeat="chart in vis.params.chart.series"
class="kuiSideBarSection"
>
<button
class="kuiSideBarCollapsibleTitle"
aria-label="Open Editor"
ng-click="isSeriesOpen = !isSeriesOpen"
type="button"
>
<span
aria-hidden="true"
ng-class="{ 'fa-caret-down': isSeriesOpen, 'fa-caret-right': !isSeriesOpen }"
class="fa fa-caret-right kuiSideBarCollapsibleTitle__caret"
></span>
<span class="kuiSideBarCollapsibleTitle__text">
{{chart.data.label}}
</span>
</button>
<div class="kuiSideBarCollapsibleTitle">
<div
class="kuiSideBarCollapsibleTitle__label"
ng-click="isSeriesOpen = !isSeriesOpen"
>
<span
aria-hidden="true"
ng-class="{ 'fa-caret-down': isSeriesOpen, 'fa-caret-right': !isSeriesOpen }"
class="fa fa-caret-right kuiSideBarCollapsibleTitle__caret"
></span>
<span class="kuiSideBarCollapsibleTitle__text">
{{chart.data.label}}
</span>
</div>
</div>

<div ng-show="isSeriesOpen" class="kuiSideBarCollapsibleSection">
<!-- General -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,31 @@
ng-repeat="axis in vis.params.valueAxes track by axis.id"
class="kuiSideBarSection"
>
<button
class="kuiSideBarCollapsibleTitle"
aria-label="Open Editor"
ng-click="isValueAxisOpen = !isValueAxisOpen"
type="button"
>
<span
aria-hidden="true"
ng-class="{ 'fa-caret-down': isValueAxisOpen, 'fa-caret-right': !isValueAxisOpen }"
class="fa fa-caret-right kuiSideBarCollapsibleTitle__caret"
></span>
<span class="kuiSideBarCollapsibleTitle__text">
{{axis.id}}
</span>
<div class="kuiSideBarCollapsibleTitle">
<div
class="kuiSideBarCollapsibleTitle__label"
ng-click="isValueAxisOpen = !isValueAxisOpen"
>
<span
aria-hidden="true"
ng-class="{ 'fa-caret-down': isValueAxisOpen, 'fa-caret-right': !isValueAxisOpen }"
class="fa fa-caret-right kuiSideBarCollapsibleTitle__caret"
></span>
<span class="kuiSideBarCollapsibleTitle__text">
{{axis.id}}
</span>
</div>

<button
ng-hide="vis.params.valueAxes.length === 1"
aria-label="Remove value axis"
ng-click="removeValueAxis(axis)"
tooltip="Remove value axis"
tooltip-append-to-body="true"
type="button"
class="fa fa-remove kuiSideBarSectionTitle__action"
class="fa fa-remove kuiSideBarCollapsibleTitle__action"
Copy link
Author

Choose a reason for hiding this comment

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

Keep in mind we can't mix and match descendent components like this (kuiSideBarSectionTitle and kuiSideBarCollapsibleTitle in this case).

></button>
</button>
</div>

<div ng-show="isValueAxisOpen" class="kuiSideBarCollapsibleSection">
<!-- General -->
Expand Down
33 changes: 22 additions & 11 deletions src/ui/public/styles/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -753,25 +753,24 @@ fieldset {
}
}

/**
* 1. Undo Bootstrap button styles.
*/
.kuiSideBarCollapsibleTitle {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
text-align: left;
border: 0; // 1
background-color: transparent; // 1
padding: 0; // 1
margin-bottom: 4px;
border-bottom: 1px solid #E8E8E8;
}

.kuiSideBarCollapsibleTitle__label {
display: flex;
align-items: center;
}

/**
* 1. Override FontAwesome .fa styles.
*/
.kuiSideBarCollapsibleTitle__caret {
display: inline-block;
vertical-align: middle;
width: 12px;
height: 12px;
font-size: 12px !important; // 1
Expand All @@ -780,13 +779,25 @@ fieldset {
}

.kuiSideBarCollapsibleTitle__text {
display: inline-block;
vertical-align: middle;
font-size: 12px;
font-weight: 700;
color: #5A5A5A;
}

/**
* 1. Override Bootstrap button styles.
*/
.kuiSideBarCollapsibleTitle__action {
background-color: transparent; // 1
padding: 0; // 1
cursor: pointer;
color: #328CAA;

&:hover {
color: #105A73;
}
}

.kuiSideBarCollapsibleSection {
padding-left: 16px;
}
Expand Down