Skip to content

Commit

Permalink
feat(layer-selector-ui): add a template to choice brick
Browse files Browse the repository at this point in the history
An option to have an inline choice brick - label and options
are on the same line.

Related #9442
  • Loading branch information
AleksueiR committed May 4, 2015
1 parent 39de4bb commit 5b9f09e
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 1 deletion.
63 changes: 63 additions & 0 deletions src/css/effects/brick-effects.less
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,34 @@
}
}

.button-brick-inline-container {
.button-brick-container;
margin: 0 0 10px 0;

.button-content {
position: relative;
display: inline-block;
vertical-align: middle;
width: 100%;

span {
line-height: 31px;
//display: inline-block;
}

button {
//position: absolute;
//right: 0;
float: right;
}
}
}

.checkbox-brick-container {
.checkbox {
min-height: inherit;
}

.checkbox-content {
margin: 0;

Expand Down Expand Up @@ -296,6 +323,42 @@
}
}

.choice-brick-inline-container {
.choice-brick-container;

.choice-group {

span {
//line-height: 31px;
}

button {
float: right;
font-size: 95%;
border: none !important;
box-shadow: none !important;
background-color: transparent !important;
color: @light-light-grey-color;

&.focused, &:focus, &:hover {
color: #fff !important;
}

&.button-pressed {
text-decoration: none;

.fa {
display: inline-block;
}
}

.fa {
display: none;
}
}
}
}

.simpleinput-brick-container {
.form-group {

Expand Down
2 changes: 1 addition & 1 deletion src/css/effects/button-effects.less
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
&.focused,
&:focus, &:hover {
background-color: #D4D4D4 !important;
color: inherit !important;
color: #000 !important; //inherit !important;

span {
color: #000 !important;
Expand Down
30 changes: 30 additions & 0 deletions src/js/RAMP/Utils/templates/bricks_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
</div>
",

"default_button_brick_inline_template": "

{% include('default_brick_notice_placeholder', o); %}
<div class='button-content'>
<span class=''>{%= o.header %}</span>
<button class='btn {%= o.buttonClass %}'>{%= o.label %}</button>
</div>
",

"default_choice_brick_template": "

{% include('default_brick_header', o); %}
Expand All @@ -83,10 +92,31 @@
</div>
",

"default_choice_brick_inline_template": "

{% include('default_brick_notice_placeholder', o); %}
<div class='btn-group choice-group'>
<span class=''>{%= o.header %}</span>

{%
o.choices.forEach(function(choice) {
include('default_choice_brick_inline_button_template', choice);
});
%}
</div>
",

"default_choice_brick_button_template": "
<button class='btn btn-sm btn-default btn-choice' data-key='{%= o.key %}'>{%= o.value %}</button>
",

"default_choice_brick_inline_button_template": "
<button class='btn btn-xs button-none btn-choice' data-key='{%= o.key %}'>
<i class='fa fa-check on-left'></i>{%= o.value %}
</button>
",


"default_checkbox_brick_template": "

{% include('default_brick_header', o); %}
Expand Down

0 comments on commit 5b9f09e

Please sign in to comment.