Skip to content

Commit

Permalink
Updated component to version 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Semantic-Pusher-Robot committed Jun 26, 2016
1 parent ea0a6ab commit e87a511
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 40 deletions.
5 changes: 5 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Version 2.2.0 - June 26, 2016

- **Checkbox** - Fixed issue where docs refer to `onEnable` and `onDisable` with checkbox but callback was called `onEnabled` and `onDisabled`, both callbacks will now be valid until 3.0 [#3761](https://github.com/Semantic-Org/Semantic-UI/issues/3761) [#3763](https://github.com/Semantic-Org/Semantic-UI/issues/3763)
- **Checkbox** - Radio buttons received `indeterminate` styles when user has not yet interacted with the page in Chrome

### Version 2.1.6 - Nov 6, 2015

- **Checkbox/Dropdown/Search** - Fixed issue where dropdown/checkbox `change` events were not bubbling. (Dispatched events were swapped to use native `document.creatEvent` in `2.1.5` unfortunately the flag to bubble events was mistakenly off.)
Expand Down
21 changes: 10 additions & 11 deletions checkbox.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*!
* # Semantic UI 2.1.7 - Checkbox
* # Semantic UI 2.2.0 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
Expand Down Expand Up @@ -189,13 +188,13 @@
Indeterminate
---------------*/

.ui.checkbox input:indeterminate ~ .box:before,
.ui.checkbox input:indeterminate ~ label:before {
.ui.checkbox input:not([type=radio]):indeterminate ~ .box:before,
.ui.checkbox input:not([type=radio]):indeterminate ~ label:before {
background: #FFFFFF;
border-color: rgba(34, 36, 38, 0.35);
}
.ui.checkbox input:indeterminate ~ .box:after,
.ui.checkbox input:indeterminate ~ label:after {
.ui.checkbox input:not([type=radio]):indeterminate ~ .box:after,
.ui.checkbox input:not([type=radio]):indeterminate ~ label:after {
opacity: 1;
color: rgba(0, 0, 0, 0.95);
}
Expand All @@ -204,15 +203,15 @@
Active Focus
---------------*/

.ui.checkbox input:indeterminate:focus ~ .box:before,
.ui.checkbox input:indeterminate:focus ~ label:before,
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ .box:before,
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ label:before,
.ui.checkbox input:checked:focus ~ .box:before,
.ui.checkbox input:checked:focus ~ label:before {
background: #FFFFFF;
border-color: #96C8DA;
}
.ui.checkbox input:indeterminate:focus ~ .box:after,
.ui.checkbox input:indeterminate:focus ~ label:after,
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ .box:after,
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ label:after,
.ui.checkbox input:checked:focus ~ .box:after,
.ui.checkbox input:checked:focus ~ label:after {
color: rgba(0, 0, 0, 0.95);
Expand All @@ -235,7 +234,7 @@
.ui.disabled.checkbox label,
.ui.checkbox input[disabled] ~ .box:after,
.ui.checkbox input[disabled] ~ label {
cursor: default;
cursor: default !important;
opacity: 0.5;
color: #000000;
}
Expand Down
42 changes: 32 additions & 10 deletions checkbox.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
/*!
* # Semantic UI 2.1.7 - Checkbox
* # Semantic UI 2.2.0 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/

;(function ( $, window, document, undefined ) {
;(function ($, window, document, undefined) {

"use strict";

window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;

$.fn.checkbox = function(parameters) {
var
$allModules = $(this),
Expand Down Expand Up @@ -120,13 +126,13 @@ $.fn.checkbox = function(parameters) {

hide: {
input: function() {
module.verbose('Modfying <input> z-index to be unselectable');
module.verbose('Modifying <input> z-index to be unselectable');
$input.addClass(className.hidden);
}
},
show: {
input: function() {
module.verbose('Modfying <input> z-index to be selectable');
module.verbose('Modifying <input> z-index to be selectable');
$input.removeClass(className.hidden);
}
},
Expand Down Expand Up @@ -268,6 +274,8 @@ $.fn.checkbox = function(parameters) {
}
module.debug('Enabling checkbox');
module.set.enabled();
settings.onEnable.call(input);
// preserve legacy callbacks
settings.onEnabled.call(input);
},

Expand All @@ -278,6 +286,8 @@ $.fn.checkbox = function(parameters) {
}
module.debug('Disabling checkbox');
module.set.disabled();
settings.onDisable.call(input);
// preserve legacy callbacks
settings.onDisabled.call(input);
},

Expand Down Expand Up @@ -584,7 +594,12 @@ $.fn.checkbox = function(parameters) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
settings[name] = value;
if($.isPlainObject(settings[name])) {
$.extend(true, settings[name], value);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
Expand All @@ -602,7 +617,7 @@ $.fn.checkbox = function(parameters) {
}
},
debug: function() {
if(settings.debug) {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
Expand All @@ -613,7 +628,7 @@ $.fn.checkbox = function(parameters) {
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
Expand All @@ -624,8 +639,10 @@ $.fn.checkbox = function(parameters) {
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
}
},
performance: {
log: function(message) {
Expand Down Expand Up @@ -760,6 +777,7 @@ $.fn.checkbox.settings = {
name : 'Checkbox',
namespace : 'checkbox',

silent : false,
debug : false,
verbose : true,
performance : true,
Expand All @@ -784,6 +802,10 @@ $.fn.checkbox.settings = {
onEnable : function(){},
onDisable : function(){},

// preserve misspelled callbacks (will be removed in 3.0)
onEnabled : function(){},
onDisabled : function(){},

className : {
checked : 'checked',
indeterminate : 'indeterminate',
Expand Down
5 changes: 2 additions & 3 deletions checkbox.min.css

Large diffs are not rendered by default.

5 changes: 2 additions & 3 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.1.7"
"version": "2.2.0"
}
42 changes: 32 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
/*!
* # Semantic UI 2.1.7 - Checkbox
* # Semantic UI 2.2.0 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/

;(function ( $, window, document, undefined ) {
;(function ($, window, document, undefined) {

"use strict";

window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;

var _module = module;
module.exports = function(parameters) {
var
Expand Down Expand Up @@ -121,13 +127,13 @@ module.exports = function(parameters) {

hide: {
input: function() {
module.verbose('Modfying <input> z-index to be unselectable');
module.verbose('Modifying <input> z-index to be unselectable');
$input.addClass(className.hidden);
}
},
show: {
input: function() {
module.verbose('Modfying <input> z-index to be selectable');
module.verbose('Modifying <input> z-index to be selectable');
$input.removeClass(className.hidden);
}
},
Expand Down Expand Up @@ -269,6 +275,8 @@ module.exports = function(parameters) {
}
module.debug('Enabling checkbox');
module.set.enabled();
settings.onEnable.call(input);
// preserve legacy callbacks
settings.onEnabled.call(input);
},

Expand All @@ -279,6 +287,8 @@ module.exports = function(parameters) {
}
module.debug('Disabling checkbox');
module.set.disabled();
settings.onDisable.call(input);
// preserve legacy callbacks
settings.onDisabled.call(input);
},

Expand Down Expand Up @@ -585,7 +595,12 @@ module.exports = function(parameters) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
settings[name] = value;
if($.isPlainObject(settings[name])) {
$.extend(true, settings[name], value);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
Expand All @@ -603,7 +618,7 @@ module.exports = function(parameters) {
}
},
debug: function() {
if(settings.debug) {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
Expand All @@ -614,7 +629,7 @@ module.exports = function(parameters) {
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
Expand All @@ -625,8 +640,10 @@ module.exports = function(parameters) {
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
}
},
performance: {
log: function(message) {
Expand Down Expand Up @@ -761,6 +778,7 @@ _module.exports.settings = {
name : 'Checkbox',
namespace : 'checkbox',

silent : false,
debug : false,
verbose : true,
performance : true,
Expand All @@ -785,6 +803,10 @@ _module.exports.settings = {
onEnable : function(){},
onDisable : function(){},

// preserve misspelled callbacks (will be removed in 3.0)
onEnabled : function(){},
onDisabled : function(){},

className : {
checked : 'checked',
indeterminate : 'indeterminate',
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.1.7',
version : '2.2.0',
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.1.7",
"version": "2.2.0",
"title": "Semantic UI - Checkbox",
"description": "Single component release of checkbox",
"homepage": "http://www.semantic-ui.com",
Expand Down

0 comments on commit e87a511

Please sign in to comment.