From 1340f01a97faf715d5c6a6a4149e805ad1d2cb1d Mon Sep 17 00:00:00 2001 From: Pusher Robot Date: Mon, 6 Jul 2015 17:01:02 -0400 Subject: [PATCH] Updated distribution to version 2.0.1 --- definitions/behaviors/form.js | 2 +- definitions/collections/form.less | 2 +- definitions/collections/menu.less | 6 ++- definitions/elements/label.less | 12 ++--- definitions/elements/segment.less | 4 +- definitions/modules/checkbox.js | 63 +++++++++++++---------- definitions/modules/checkbox.less | 16 +++--- definitions/modules/dropdown.js | 24 ++++++--- definitions/modules/dropdown.less | 3 +- definitions/modules/popup.js | 2 +- definitions/modules/progress.js | 3 +- definitions/modules/tab.js | 16 +++--- definitions/modules/transition.js | 2 +- definitions/views/card.less | 3 ++ package.js | 2 +- package.json | 2 +- themes/default/collections/menu.variables | 6 +-- themes/default/elements/label.variables | 3 ++ 18 files changed, 101 insertions(+), 70 deletions(-) diff --git a/definitions/behaviors/form.js b/definitions/behaviors/form.js index e3c369b..15baef7 100755 --- a/definitions/behaviors/form.js +++ b/definitions/behaviors/form.js @@ -201,7 +201,7 @@ $.fn.form = function(parameters) { isErrored = $fieldGroup.hasClass(className.error) ; if(defaultValue === undefined) { - defaultValue = ''; + return; } if(isErrored) { module.verbose('Resetting error on field', $fieldGroup); diff --git a/definitions/collections/form.less b/definitions/collections/form.less index 214a61c..bb6ad2c 100755 --- a/definitions/collections/form.less +++ b/definitions/collections/form.less @@ -49,7 +49,7 @@ clear: both; margin: @fieldMargin; } -.ui.form .field .field, + .ui.form .field:last-child, .ui.form .fields:last-child .field { margin-bottom: 0em; diff --git a/definitions/collections/menu.less b/definitions/collections/menu.less index 2065b72..d0f4589 100755 --- a/definitions/collections/menu.less +++ b/definitions/collections/menu.less @@ -498,6 +498,7 @@ Floated Menu / Item .ui.vertical.menu { display: block; + flex-direction: column; background: @verticalBackground; box-shadow: @verticalBoxShadow; } @@ -1530,6 +1531,9 @@ Floated Menu / Item margin: 0em; vertical-align: middle; } +.ui.compact.vertical.menu { + display: inline-block; +} .ui.compact.menu .item:last-child { border-radius: 0em @borderRadius @borderRadius 0em; } @@ -1622,13 +1626,13 @@ Floated Menu / Item .ui.fixed.menu, .ui[class*="top fixed"].menu { - border-top: none; top: 0px; left: 0px; right: auto; bottom: auto; } .ui[class*="top fixed"].menu { + border-top: none; border-left: none; border-right: none; } diff --git a/definitions/elements/label.less b/definitions/elements/label.less index 81d427d..e10f35e 100755 --- a/definitions/elements/label.less +++ b/definitions/elements/label.less @@ -403,31 +403,31 @@ a.ui.label { padding: @attachedVerticalPadding @attachedHorizontalPadding; - border-radius: @borderRadius @borderRadius 0em 0em; + border-radius: @attachedCornerBorderRadius @attachedCornerBorderRadius 0em 0em; } .ui.bottom.attached.label { top: auto; bottom: 0em; - border-radius: 0em 0em @borderRadius @borderRadius; + border-radius: 0em 0em @attachedCornerBorderRadius @attachedCornerBorderRadius; } .ui.top.left.attached.label { width: auto; margin-top: 0em !important; - border-radius: @borderRadius 0em @borderRadius 0em; + border-radius: @attachedCornerBorderRadius 0em @attachedBorderRadius 0em; } .ui.top.right.attached.label { width: auto; left: auto; right: 0em; - border-radius: 0em @borderRadius 0em @borderRadius; + border-radius: 0em @attachedCornerBorderRadius 0em @attachedBorderRadius; } .ui.bottom.left.attached.label { width: auto; top: auto; bottom: 0em; - border-radius: 0em @borderRadius 0em @borderRadius; + border-radius: 0em @attachedBorderRadius 0em @attachedCornerBorderRadius; } .ui.bottom.right.attached.label { top: auto; @@ -435,7 +435,7 @@ a.ui.label { left: auto; right: 0em; width: auto; - border-radius: @borderRadius 0em @borderRadius 0em; + border-radius: @attachedBorderRadius 0em @attachedCornerBorderRadius 0em; } diff --git a/definitions/elements/segment.less b/definitions/elements/segment.less index 121ee4a..0dbcc77 100755 --- a/definitions/elements/segment.less +++ b/definitions/elements/segment.less @@ -693,7 +693,7 @@ .ui[class*="top attached"].segment { top: @attachedTopOffset; bottom: 0px; - margin-top: @margin; + margin-top: @verticalMargin; margin-bottom: 0em; border-radius: @borderRadius @borderRadius 0em 0em; } @@ -706,7 +706,7 @@ top: @attachedBottomOffset; bottom: 0px; margin-top: 0em; - margin-bottom: @margin; + margin-bottom: @verticalMargin; box-shadow: @attachedBottomBoxShadow; border-radius: 0em 0em @borderRadius @borderRadius; } diff --git a/definitions/modules/checkbox.js b/definitions/modules/checkbox.js index 49e1786..029344b 100755 --- a/definitions/modules/checkbox.js +++ b/definitions/modules/checkbox.js @@ -271,6 +271,9 @@ $.fn.checkbox = function(parameters) { ; return $('input[name="' + name + '"]').closest(selector.checkbox); }, + otherRadios: function() { + return module.get.radios().not($module); + }, name: function() { return $input.attr('name'); } @@ -314,25 +317,31 @@ $.fn.checkbox = function(parameters) { set: { checked: function() { + module.verbose('Setting class to checked'); + $module + .removeClass(className.indeterminate) + .addClass(className.checked) + ; + if( module.is.radio() ) { + module.uncheckOthers(); + } if(!module.is.indeterminate() && module.is.checked()) { - module.debug('Input is already checked'); + module.debug('Input is already checked, skipping input property change'); return; } module.verbose('Setting state to checked', $input[0]); - if( module.is.radio() ) { - module.uncheckOthers(); - } $input .prop('indeterminate', false) .prop('checked', true) ; - $module - .removeClass(className.indeterminate) - .addClass(className.checked) - ; module.trigger.change(); }, unchecked: function() { + module.verbose('Removing checked class'); + $module + .removeClass(className.indeterminate) + .removeClass(className.checked) + ; if(!module.is.indeterminate() && module.is.unchecked() ) { module.debug('Input is already unchecked'); return; @@ -342,63 +351,63 @@ $.fn.checkbox = function(parameters) { .prop('indeterminate', false) .prop('checked', false) ; - $module - .removeClass(className.indeterminate) - .removeClass(className.checked) - ; module.trigger.change(); }, indeterminate: function() { + module.verbose('Setting class to indeterminate'); + $module + .addClass(className.indeterminate) + ; if( module.is.indeterminate() ) { - module.debug('Input is already indeterminate'); + module.debug('Input is already indeterminate, skipping input property change'); return; } module.debug('Setting state to indeterminate'); $input .prop('indeterminate', true) ; - $module - .addClass(className.indeterminate) - ; module.trigger.change(); }, determinate: function() { + module.verbose('Removing indeterminate class'); + $module + .removeClass(className.indeterminate) + ; if( module.is.determinate() ) { - module.debug('Input is already determinate'); + module.debug('Input is already determinate, skipping input property change'); return; } module.debug('Setting state to determinate'); $input .prop('indeterminate', false) ; - $module - .removeClass(className.indeterminate) - ; }, disabled: function() { + module.verbose('Setting class to disabled'); + $module + .addClass(className.disabled) + ; if( module.is.disabled() ) { - module.debug('Input is already disabled'); + module.debug('Input is already disabled, skipping input property change'); return; } module.debug('Setting state to disabled'); $input .prop('disabled', 'disabled') ; - $module - .addClass(className.disabled) - ; module.trigger.change(); }, enabled: function() { + module.verbose('Removing disabled class'); + $module.removeClass(className.disabled); if( module.is.enabled() ) { - module.debug('Input is already enabled'); + module.debug('Input is already enabled, skipping input property change'); return; } module.debug('Setting state to enabled'); $input .prop('disabled', false) ; - $module.removeClass(className.disabled); module.trigger.change(); }, tabbable: function() { @@ -459,7 +468,7 @@ $.fn.checkbox = function(parameters) { uncheckOthers: function() { var - $radios = module.get.radios() + $radios = module.get.otherRadios() ; module.debug('Unchecking other radios', $radios); $radios.removeClass(className.checked); diff --git a/definitions/modules/checkbox.less b/definitions/modules/checkbox.less index c076057..b3a7cdc 100755 --- a/definitions/modules/checkbox.less +++ b/definitions/modules/checkbox.less @@ -203,13 +203,13 @@ Indeterminate ---------------*/ -.ui.checkbox input:indeterminate ~ .box:before, -.ui.checkbox input:indeterminate ~ label:before { +.ui.checkbox input[type="checkbox"]:indeterminate ~ .box:before, +.ui.checkbox input[type="checkbox"]:indeterminate ~ label:before { background: @checkboxIndeterminateBackground; border-color: @checkboxIndeterminateBorderColor; } -.ui.checkbox input:indeterminate ~ .box:after, -.ui.checkbox input:indeterminate ~ label:after { +.ui.checkbox input[type="checkbox"]:indeterminate ~ .box:after, +.ui.checkbox input[type="checkbox"]:indeterminate ~ label:after { opacity: @checkboxIndeterminateCheckOpacity; color: @checkboxIndeterminateCheckColor; } @@ -218,10 +218,10 @@ Active Focus ---------------*/ -.ui.checkbox input[type="radio"]:indeterminate:focus ~ .box:before, -.ui.checkbox input[type="radio"]:indeterminate:focus ~ label:before, -.ui.checkbox input[type="radio"]:checked:focus ~ .box:before, -.ui.checkbox input[type="radio"]:checked:focus ~ label:before { +.ui.checkbox input[type="checkbox"]:indeterminate:focus ~ .box:before, +.ui.checkbox input[type="checkbox"]:indeterminate:focus ~ label:before, +.ui.checkbox input[type="checkbox"]:checked:focus ~ .box:before, +.ui.checkbox input[type="checkbox"]:checked:focus ~ label:before { background: @checkboxFocusedBackground; border-color: @checkboxFocusedBorderColor; } diff --git a/definitions/modules/dropdown.js b/definitions/modules/dropdown.js index 56cc11f..9790db9 100755 --- a/definitions/modules/dropdown.js +++ b/definitions/modules/dropdown.js @@ -473,7 +473,7 @@ $.fn.dropdown = function(parameters) { if( module.is.searchSelection() ) { // do nothing special yet } - else { + else if( module.is.single() ) { $module .on('touchstart' + eventNamespace, module.event.test.toggle) ; @@ -2544,6 +2544,9 @@ $.fn.dropdown = function(parameters) { input: function() { return ($input.length > 0); }, + items: function() { + return ($item.length > 0); + }, menu: function() { return ($menu.length > 0); }, @@ -2589,6 +2592,9 @@ $.fn.dropdown = function(parameters) { : $menu.transition && $menu.transition('is animating') ; }, + disabled: function() { + $module.hasClass(className.disabled); + }, focused: function() { return (document.activeElement === $module[0]); }, @@ -2700,7 +2706,7 @@ $.fn.dropdown = function(parameters) { return (hasTouch || settings.on == 'click'); }, show: function() { - return !$module.hasClass(className.disabled) && $item.length > 0; + return !module.is.disabled() && (module.has.items() || module.has.message()); }, useAPI: function() { return $.fn.api !== undefined; @@ -2810,14 +2816,18 @@ $.fn.dropdown = function(parameters) { }, hideAndClear: function() { - if(module.has.search()) { + if( module.has.maxSelections() ) { module.remove.searchTerm(); - module.hide(function() { - module.remove.filteredItem(); - }); } else { - module.hide(); + if(module.has.search()) { + module.hide(function() { + module.remove.filteredItem(); + }); + } + else { + module.hide(); + } } }, diff --git a/definitions/modules/dropdown.less b/definitions/modules/dropdown.less index 17f0769..42d64f1 100755 --- a/definitions/modules/dropdown.less +++ b/definitions/modules/dropdown.less @@ -27,10 +27,11 @@ cursor: pointer; position: relative; display: inline-block; - tap-highlight-color: rgba(0, 0, 0, 0); outline: none; text-align: left; transition: @transition; + + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } /******************************* diff --git a/definitions/modules/popup.js b/definitions/modules/popup.js index bb3bd46..16360ab 100755 --- a/definitions/modules/popup.js +++ b/definitions/modules/popup.js @@ -687,7 +687,7 @@ $.fn.popup = function(parameters) { popup = calculations.popup; parent = calculations.parent; - if(target.top === 0 && target.left === 0) { + if(target.width === 0 && target.height === 0) { module.debug('Popup target is hidden, no action taken'); return false; } diff --git a/definitions/modules/progress.js b/definitions/modules/progress.js index c09bda2..ce77424 100755 --- a/definitions/modules/progress.js +++ b/definitions/modules/progress.js @@ -117,6 +117,7 @@ $.fn.progress = function(parameters) { if(data.value) { module.debug('Current value set from metadata', data.value); module.set.value(data.value); + module.set.progress(data.value); } }, settings: function() { @@ -719,7 +720,7 @@ $.fn.progress.settings = { name : 'Progress', namespace : 'progress', - debug : true, + debug : false, verbose : false, performance : true, diff --git a/definitions/modules/tab.js b/definitions/modules/tab.js index 57cbb24..e1860d8 100755 --- a/definitions/modules/tab.js +++ b/definitions/modules/tab.js @@ -440,9 +440,12 @@ $.fn.tab = function(parameters) { var $tab = module.get.tabElement(tabPath), apiSettings = { - dataType : 'html', - on : 'now', - cache : 'local', + dataType : 'html', + on : 'now', + cache : settings.alwaysRefresh, + headers : { + 'X-Remote': true + }, onSuccess : function(response) { module.cache.add(fullTabPath, response); module.update.content(tabPath, response); @@ -486,12 +489,9 @@ $.fn.tab = function(parameters) { module.debug('Content is already loading', fullTabPath); } else if($.api !== undefined) { - requestSettings = $.extend(true, { - headers: { - 'X-Remote': true - } - }, settings.apiSettings, apiSettings); + requestSettings = $.extend(true, {}, settings.apiSettings, apiSettings); module.debug('Retrieving remote content', fullTabPath, requestSettings); + module.set.loading(tabPath); $tab.api(requestSettings); } else { diff --git a/definitions/modules/transition.js b/definitions/modules/transition.js index d281bec..0f84f31 100755 --- a/definitions/modules/transition.js +++ b/definitions/modules/transition.js @@ -614,7 +614,7 @@ $.fn.transition = function() { }, userStyle: function(style) { style = style || $module.attr('style') || ''; - return style.replace(/display.*?;/, '');; + return style.replace(/display.*?;/, ''); }, transitionExists: function(animation) { return $.fn.transition.exists[animation]; diff --git a/definitions/views/card.less b/definitions/views/card.less index f236947..aa69d51 100755 --- a/definitions/views/card.less +++ b/definitions/views/card.less @@ -425,6 +425,9 @@ Centered --------------------*/ +.ui.centered.cards { + justify-content: center; +} .ui.centered.card { margin-left: auto; margin-right: auto; diff --git a/package.js b/package.js index 60395d5..20b425a 100644 --- a/package.js +++ b/package.js @@ -5,7 +5,7 @@ var Package.describe({ name : 'semantic:ui', summary : 'Semantic UI - LESS Release of Semantic UI', - version : '2.0.0', + version : '2.0.1', git : 'git://github.com/Semantic-Org/Semantic-UI-LESS.git', }); diff --git a/package.json b/package.json index b21cdbd..f3ded46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "semantic-ui-less", - "version": "2.0.0", + "version": "2.0.1", "title": "Semantic UI", "description": "LESS Only distribution of Semantic UI", "homepage": "http://www.semantic-ui.com", diff --git a/themes/default/collections/menu.variables b/themes/default/collections/menu.variables index 547a10d..96893d3 100755 --- a/themes/default/collections/menu.variables +++ b/themes/default/collections/menu.variables @@ -90,8 +90,8 @@ @arrowTransition: background @defaultDuration @defaultEasing; @arrowZIndex: 2; -@arrowHoverColor: #F4F4F4; -@arrowActiveColor: #F4F4F4; +@arrowHoverColor: #F2F2F2; +@arrowActiveColor: @arrowHoverColor; @arrowActiveHoverColor: @arrowActiveColor; @arrowVerticalHoverColor: @arrowHoverColor; @@ -370,7 +370,7 @@ /* Inverted */ @invertedBackground: @black; @invertedBoxShadow: none; -@invertedBorder: 1px solid transparent; +@invertedBorder: 0px solid transparent; @invertedHeaderBackground: transparent; @invertedItemBackground: transparent; diff --git a/themes/default/elements/label.variables b/themes/default/elements/label.variables index 5f27896..149ec0b 100755 --- a/themes/default/elements/label.variables +++ b/themes/default/elements/label.variables @@ -172,6 +172,9 @@ @attachedVerticalPadding: 0.75em; @attachedHorizontalPadding: 1em; +@attachedCornerBorderRadius: @3px; +@attachedBorderRadius: @borderRadius; + /* Corner */ @cornerSizeRatio: 1; @cornerTransition: color @labelTransitionDuration @labelTransitionEasing;