Skip to content

Commit

Permalink
Merge branch 'master' into #13/fix-checkboxgroups-return-value
Browse files Browse the repository at this point in the history
  • Loading branch information
keegan-lillo committed Mar 2, 2016
2 parents 28fa722 + a98b4e6 commit fa59ea9
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 26 deletions.
4 changes: 2 additions & 2 deletions dev/custom-fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ module.exports = function() {
*/
function toggleBackground() {
if (this.get()) {
Clay.getItemByAppKey('background').enable();
Clay.getItemByAppKey('colorTest').enable();
} else {
Clay.getItemByAppKey('background').disable();
Clay.getItemByAppKey('colorTest').disable();
}
}

Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ gulp.task('dev-js', ['js', 'sass'], function() {
.transform(stringify(stringifyOptions))
.transform('deamdify')
.transform(sassify, sassifyOptions)
.transform(autoprefixify, autoprefixerOptions)
.bundle()
.pipe(source('dev.js'))
.pipe(gulp.dest('./tmp/'));
Expand Down
6 changes: 4 additions & 2 deletions src/scripts/components/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ module.exports = {

var $value = self.$element.select('.value');

self.on('change', function(ev) {
var value = self.$manipulatorTarget.select('option:checked').get('innerHTML');
self.on('change', function() {
var selectedIndex = self.$manipulatorTarget.get('selectedIndex');
var $options = self.$manipulatorTarget.select('option');
var value = $options[selectedIndex] && $options[selectedIndex].innerHTML;
$value.set('innerHTML', value);
});
}
Expand Down
1 change: 1 addition & 0 deletions src/scripts/components/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module.exports = {
name: 'submit',
template: require('../../templates/components/submit.tpl'),
style: require('../../styles/clay/components/submit.scss'),
manipulator: 'html',
defaults: {
attributes: {}
Expand Down
19 changes: 13 additions & 6 deletions src/styles/clay/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ label {
}
}

.tap-highlight {
@include tap-highlight();
}

.component {
padding-bottom: $item-spacing-v;
@include tap-highlight();

&.disabled {
opacity: 0.25;
Expand All @@ -108,10 +111,10 @@ label {
&:last-child,
&:first-child {
padding-bottom: $item-spacing-v;
&:after {
display: none;
}
}

&:last-child:after {
display: none;
}

&:after {
Expand All @@ -130,6 +133,10 @@ label {
.component-heading:first-child {
background: $color-gray-3;
border-radius: $border-radius $border-radius 0 0;

&:after {
display: none;
}
}

}
Expand Down Expand Up @@ -160,7 +167,7 @@ a {
.input {
display: table-cell;
}

.input {
text-align: right;
}
Expand Down
5 changes: 1 addition & 4 deletions src/styles/clay/components/checkboxgroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

.component-checkbox {

@include tap-highlight(rgba(0,0,0,0));
display: block;


> .label {
display: block;
padding-bottom: $item-spacing-v / 2;
Expand All @@ -16,7 +14,6 @@

label {
padding: $item-spacing-v / 2 0;
@include tap-highlight();
}

.label {
Expand All @@ -39,7 +36,7 @@
flex-shrink: 0;
}

input:checked ~ i {
input:checked + i {
border-color: $color-orange;
background: $color-orange;

Expand Down
1 change: 1 addition & 0 deletions src/styles/clay/components/color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
height: $base-height;
border-radius: $base-height / 2;
box-shadow: $box-shadow-small-components;
display: block;
}

.picker-wrap {
Expand Down
5 changes: 1 addition & 4 deletions src/styles/clay/components/radiogroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

.component-radio {

@include tap-highlight(rgba(0,0,0,0));
display: block;


> .label {
display: block;
padding-bottom: $item-spacing-v / 2;
Expand All @@ -16,7 +14,6 @@

label {
padding: $item-spacing-v / 2 0;
@include tap-highlight();
}

.label {
Expand All @@ -39,7 +36,7 @@
flex-shrink: 0;
}

input:checked ~ i {
input:checked + i {
border-color: $color-orange;

&:after {
Expand Down
1 change: 1 addition & 0 deletions src/styles/clay/components/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$triangle-size: 0.85rem;
position: relative;
padding-right: $triangle-size + 0.25rem;
display: block;

&:after {
content: "";
Expand Down
3 changes: 3 additions & 0 deletions src/styles/clay/components/submit.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.component-submit {
text-align: center;
}
2 changes: 1 addition & 1 deletion src/styles/clay/elements/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ button,
font-size: 1rem;
line-height: 1;
border: none;
display: block;
display: inline-block;

color: $color-white;
min-width: 12rem;
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/checkboxgroup.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<span class="label">{{{label}}}</span>
<div class="checkbox-group">
{{each options}}
<label>
<label class="tap-highlight">
<span class="label">{{{this.label}}}</span>
<input
type="checkbox"
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/color.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="component component-color">
<div class="component component-color tap-highlight">
<label>
<input
data-manipulator-target
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/input.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<label class="component component-input">
<label class="component component-input tap-highlight">
<span class="label">{{{label}}}</span>
<span class="input">
<input
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/radiogroup.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<span class="label">{{{label}}}</span>
<div class="radio-group">
{{each options}}
<label>
<label class="tap-highlight">
<span class="label">{{{this.label}}}</span>
<input
type="radio"
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/select.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<label class="component component-select">
<label class="component component-select tap-highlight">
<span class="label">{{{label}}}</span>
<span class="value"></span>
<select data-manipulator-target {{each key: attributes}}{{key}}="{{this}}"{{/each}}>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/submit.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="component component-button">
<div class="component component-submit">
<button
data-manipulator-target
type="submit"
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/toggle.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<label class="component component-toggle">
<label class="component component-toggle tap-highlight">
<span class="label">{{{label}}}</span>
<span class="input">
<input
Expand Down

0 comments on commit fa59ea9

Please sign in to comment.