Skip to content

Commit

Permalink
Updated component to version 2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Semantic-Pusher-Robot committed Jul 20, 2015
1 parent 882bf82 commit c10cd98
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 17 deletions.
7 changes: 6 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
### Version 2.0.5 - July 20, 2015

- **Checkbox** - Fix issue with `onChange` not firing when space key is used. Checkbox keyboard shortcuts now occur on `keydown` but cancel events correctly on `keyup` [#2676](https://github.com/Semantic-Org/Semantic-UI/issues/2676)
- **Radio Checkbox** - Fixed regression causing radio checkboxes to all appear selected in chrome due to `:indeterminate` selector [#2505](https://github.com/Semantic-Org/Semantic-UI/issues/2505)

### Version 2.0.4 - July 17, 2015

- **Checkbox** - Checkbox now focus after click, allowing for tab navigation from current position [#2610](https://github.com/Semantic-Org/Semantic-UI/issues/2610)
- **Checkbox** - Checkbox now focuses after click, allowing for tab navigation from current position [#2610](https://github.com/Semantic-Org/Semantic-UI/issues/2610)
- **Checkbox** - Fixed checkbox not using javascript having incorrect colors on focus [#2607](https://github.com/Semantic-Org/Semantic-UI/issues/2607)
- **Checkbox** - Fixed `space` shortcut causing checkbox to trigger twice
- **Checkbox** - Updated `colored` theme to add new focus color variables.
Expand Down
8 changes: 7 additions & 1 deletion checkbox.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* # Semantic UI 2.0.4 - Checkbox
* # Semantic UI 2.0.5 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
Expand Down Expand Up @@ -321,6 +321,12 @@
background-color: rgba(0, 0, 0, 0.95);
}

/* Indeterminate */
.ui.radio.checkbox input:indeterminate ~ .box:after,
.ui.radio.checkbox input:indeterminate ~ label:after {
opacity: 0;
}

/* Active */
.ui.radio.checkbox input:checked ~ .box:before,
.ui.radio.checkbox input:checked ~ label:before {
Expand Down
19 changes: 15 additions & 4 deletions checkbox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* # Semantic UI 2.0.4 - Checkbox
* # Semantic UI 2.0.5 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
Expand Down Expand Up @@ -44,6 +44,8 @@ $.fn.checkbox = function(parameters) {
$label = $(this).children(selector.label),
$input = $(this).children(selector.input),

shortcutPressed = false,

instance = $module.data(moduleNamespace),

observer,
Expand Down Expand Up @@ -192,11 +194,19 @@ $.fn.checkbox = function(parameters) {
if(key == keyCode.escape) {
module.verbose('Escape key pressed blurring field');
$input.blur();
event.preventDefault();
shortcutPressed = true;
}
if(!event.ctrlKey && (key == keyCode.enter)) {
module.verbose('Enter key pressed, toggling checkbox');
else if(!event.ctrlKey && ( key == keyCode.space || key == keyCode.enter) ) {
module.verbose('Enter/space key pressed, toggling checkbox');
module.toggle();
shortcutPressed = true;
}
else {
shortcutPressed = false;
}
},
keyup: function(event) {
if(shortcutPressed) {
event.preventDefault();
}
}
Expand Down Expand Up @@ -455,6 +465,7 @@ $.fn.checkbox = function(parameters) {
$module
.on('click' + eventNamespace, module.event.click)
.on('keydown' + eventNamespace, selector.input, module.event.keydown)
.on('keyup' + eventNamespace, selector.input, module.event.keyup)
;
}
},
Expand Down
4 changes: 2 additions & 2 deletions checkbox.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions checkbox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"framework"
],
"license": "MIT",
"version": "2.0.4"
"version": "2.0.5"
}
19 changes: 15 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* # Semantic UI 2.0.4 - Checkbox
* # Semantic UI 2.0.5 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
Expand Down Expand Up @@ -45,6 +45,8 @@ module.exports = function(parameters) {
$label = $(this).children(selector.label),
$input = $(this).children(selector.input),

shortcutPressed = false,

instance = $module.data(moduleNamespace),

observer,
Expand Down Expand Up @@ -193,11 +195,19 @@ module.exports = function(parameters) {
if(key == keyCode.escape) {
module.verbose('Escape key pressed blurring field');
$input.blur();
event.preventDefault();
shortcutPressed = true;
}
if(!event.ctrlKey && (key == keyCode.enter)) {
module.verbose('Enter key pressed, toggling checkbox');
else if(!event.ctrlKey && ( key == keyCode.space || key == keyCode.enter) ) {
module.verbose('Enter/space key pressed, toggling checkbox');
module.toggle();
shortcutPressed = true;
}
else {
shortcutPressed = false;
}
},
keyup: function(event) {
if(shortcutPressed) {
event.preventDefault();
}
}
Expand Down Expand Up @@ -456,6 +466,7 @@ module.exports = function(parameters) {
$module
.on('click' + eventNamespace, module.event.click)
.on('keydown' + eventNamespace, selector.input, module.event.keydown)
.on('keyup' + eventNamespace, selector.input, module.event.keyup)
;
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Package.describe({
name : 'semantic:ui-checkbox',
summary : 'Semantic UI - Checkbox: Single component release',
version : '2.0.4',
version : '2.0.5',
git : 'git://github.com/Semantic-Org/UI-Checkbox.git',
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "semantic-ui-checkbox",
"version": "2.0.4",
"version": "2.0.5",
"title": "Semantic UI - Checkbox",
"description": "Single component release of checkbox",
"homepage": "http://www.semantic-ui.com",
Expand Down

0 comments on commit c10cd98

Please sign in to comment.