Skip to content

Commit

Permalink
Updated semantic UI to 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
brian committed Sep 8, 2015
1 parent af7d50f commit f43e4ea
Show file tree
Hide file tree
Showing 160 changed files with 47,842 additions and 33,916 deletions.
13 changes: 13 additions & 0 deletions scripts/update_semantic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
echo "Are you running this script from the scripts folder? y/n"
read ans
if [ ${ans} == 'y' ]; then
echo "Retrieving last version"
git clone git@github.com:Semantic-Org/Semantic-UI.git
cd ../static
git rm -r semantic-ui
cp -r ../scripts/Semantic-UI/dist semantic-ui
git add semantic-ui
cd ../scripts
rm -rf Semantic-UI
echo "Done"
fi
35 changes: 17 additions & 18 deletions static/semantic-ui/components/accordion.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*!
* # Semantic UI 1.11.6 - Accordion
* # Semantic UI 2.1.3 - Accordion
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2014 Contributors
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
Expand All @@ -17,7 +17,6 @@
.ui.accordion,
.ui.accordion .accordion {
max-width: 100%;
font-size: 1em;
}
.ui.accordion .accordion {
margin: 1em 0em 0em;
Expand All @@ -35,7 +34,7 @@
padding: 0.5em 0em;
font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1em;
color: rgba(0, 0, 0, 0.8);
color: rgba(0, 0, 0, 0.87);
}

/* Content */
Expand All @@ -47,7 +46,7 @@
/* Default Styling */
.ui.accordion:not(.styled) .title ~ .content:not(.ui),
.ui.accordion:not(.styled) .accordion .title ~ .content:not(.ui) {
margin: 0em;
margin: '';
padding: 0.5em 0em 1em;
}
.ui.accordion:not(.styled) .title ~ .content:not(.ui):last-child {
Expand All @@ -65,8 +64,8 @@
margin: 0em 0.25rem 0em 0rem;
padding: 0em;
font-size: 1em;
-webkit-transition: -webkit-transform 0.2s ease, opacity 0.2s ease;
transition: transform 0.2s ease, opacity 0.2s ease;
-webkit-transition: -webkit-transform 0.1s ease, opacity 0.1s ease;
transition: transform 0.1s ease, opacity 0.1s ease;
vertical-align: baseline;
-webkit-transform: none;
-ms-transform: none;
Expand All @@ -85,7 +84,7 @@
}
.ui.accordion.menu .item .title > .dropdown.icon {
float: right;
margin: 0.165em 0em 0em 1em;
margin: 0.21425em 0em 0em 1em;
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
Expand Down Expand Up @@ -129,19 +128,19 @@
}
.ui.styled.accordion,
.ui.styled.accordion .accordion {
border-radius: 0.2857rem;
border-radius: 0.28571429rem;
background: #ffffff;
box-shadow: 0px 1px 2px 0 rgba(0, 0, 0, 0.05), 0px 0px 0px 1px rgba(39, 41, 43, 0.15);
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15);
}
.ui.styled.accordion .title,
.ui.styled.accordion .accordion .title {
margin: 0em;
padding: 0.75em 1em;
color: rgba(0, 0, 0, 0.4);
font-weight: bold;
border-top: 1px solid rgba(39, 41, 43, 0.15);
-webkit-transition: background 0.2s ease, color 0.2s ease;
transition: background 0.2s ease, color 0.2s ease;
border-top: 1px solid rgba(34, 36, 38, 0.15);
-webkit-transition: background 0.1s ease, color 0.1s ease;
transition: background 0.1s ease, color 0.1s ease;
}
.ui.styled.accordion > .title:first-child,
.ui.styled.accordion .accordion .title:first-child {
Expand All @@ -165,22 +164,22 @@
.ui.styled.accordion .accordion .title:hover,
.ui.styled.accordion .accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.8);
color: rgba(0, 0, 0, 0.87);
}
.ui.styled.accordion .accordion .title:hover,
.ui.styled.accordion .accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.8);
color: rgba(0, 0, 0, 0.87);
}

/* Active */
.ui.styled.accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.8);
color: rgba(0, 0, 0, 0.95);
}
.ui.styled.accordion .accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.8);
color: rgba(0, 0, 0, 0.95);
}


Expand Down Expand Up @@ -218,7 +217,7 @@
---------------*/

.ui.inverted.accordion .title:not(.ui) {
color: #ffffff;
color: rgba(255, 255, 255, 0.9);
}


Expand Down
144 changes: 81 additions & 63 deletions static/semantic-ui/components/accordion.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*!
* # Semantic UI 1.11.6 - Accordion
* # Semantic UI 2.1.3 - Accordion
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2014 Contributors
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
Expand Down Expand Up @@ -63,7 +63,9 @@ $.fn.accordion = function(parameters) {
initialize: function() {
module.debug('Initializing', $module);
module.bind.events();
module.observeChanges();
if(settings.observeChanges) {
module.observeChanges();
}
module.instantiate();
},

Expand Down Expand Up @@ -105,7 +107,7 @@ $.fn.accordion = function(parameters) {
events: function() {
module.debug('Binding delegated events');
$module
.on('click' + eventNamespace, selector.trigger, module.event.click)
.on(settings.on + eventNamespace, selector.trigger, module.event.click)
;
}
},
Expand Down Expand Up @@ -153,54 +155,59 @@ $.fn.accordion = function(parameters) {
$activeContent = $activeTitle.next($content),
isAnimating = $activeContent.hasClass(className.animating),
isActive = $activeContent.hasClass(className.active),
isUnopen = (!isActive && !isAnimating)
isOpen = (isActive || isAnimating)
;
if(isOpen) {
module.debug('Accordion already open, skipping', $activeContent);
return;
}
module.debug('Opening accordion content', $activeTitle);
settings.onOpening.call($activeContent);
if(settings.exclusive) {
module.closeOthers.call($activeTitle);
}
$activeTitle
.addClass(className.active)
;
$activeContent
.stop(true, true)
.addClass(className.animating)
;
if(isUnopen) {
module.debug('Opening accordion content', $activeTitle);
if(settings.exclusive) {
module.closeOthers.call($activeTitle);
if(settings.animateChildren) {
if($.fn.transition !== undefined && $module.transition('is supported')) {
$activeContent
.children()
.transition({
animation : 'fade in',
queue : false,
useFailSafe : true,
debug : settings.debug,
verbose : settings.verbose,
duration : settings.duration
})
;
}
$activeTitle
.addClass(className.active)
;
$activeContent.addClass(className.animating);
if(settings.animateChildren) {
if($.fn.transition !== undefined && $module.transition('is supported')) {
$activeContent
.children()
.transition({
animation : 'fade in',
queue : false,
useFailSafe : true,
debug : settings.debug,
verbose : settings.verbose,
duration : settings.duration
})
;
}
else {
$activeContent
.children()
.stop(true)
.animate({
opacity: 1
}, settings.duration, module.resetOpacity)
;
}
else {
$activeContent
.children()
.stop(true, true)
.animate({
opacity: 1
}, settings.duration, module.resetOpacity)
;
}
$activeContent
.stop(true)
.slideDown(settings.duration, settings.easing, function() {
$activeContent
.removeClass(className.animating)
.addClass(className.active)
;
module.reset.display.call(this);
settings.onOpen.call(this);
settings.onChange.call(this);
})
;
}
$activeContent
.slideDown(settings.duration, settings.easing, function() {
$activeContent
.removeClass(className.animating)
.addClass(className.active)
;
module.reset.display.call(this);
settings.onOpen.call(this);
settings.onChange.call(this);
})
;
},

close: function(query) {
Expand All @@ -218,10 +225,12 @@ $.fn.accordion = function(parameters) {
;
if((isActive || isOpening) && !isClosing) {
module.debug('Closing accordion content', $activeContent);
settings.onClosing.call($activeContent);
$activeTitle
.removeClass(className.active)
;
$activeContent
.stop(true, true)
.addClass(className.animating)
;
if(settings.animateChildren) {
Expand All @@ -241,15 +250,14 @@ $.fn.accordion = function(parameters) {
else {
$activeContent
.children()
.stop(true)
.stop(true, true)
.animate({
opacity: 0
}, settings.duration, module.resetOpacity)
;
}
}
$activeContent
.stop(true)
.slideUp(settings.duration, settings.easing, function() {
$activeContent
.removeClass(className.animating)
Expand Down Expand Up @@ -291,6 +299,10 @@ $.fn.accordion = function(parameters) {
$openTitles
.removeClass(className.active)
;
$openContents
.removeClass(className.animating)
.stop(true, true)
;
if(settings.animateChildren) {
if($.fn.transition !== undefined && $module.transition('is supported')) {
$openContents
Expand All @@ -307,15 +319,14 @@ $.fn.accordion = function(parameters) {
else {
$openContents
.children()
.stop()
.stop(true, true)
.animate({
opacity: 0
}, settings.duration, module.resetOpacity)
;
}
}
$openContents
.stop()
.slideUp(settings.duration , settings.easing, function() {
$(this).removeClass(className.active);
module.reset.display.call(this);
Expand Down Expand Up @@ -422,7 +433,7 @@ $.fn.accordion = function(parameters) {
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
module.performance.timer = setTimeout(module.performance.display, 500);
},
display: function() {
var
Expand Down Expand Up @@ -534,20 +545,27 @@ $.fn.accordion.settings = {
namespace : 'accordion',

debug : false,
verbose : true,
verbose : false,
performance : true,

exclusive : true,
collapsible : true,
closeNested : false,
animateChildren : true,
on : 'click', // event on title that opens accordion

observeChanges : true, // whether accordion should automatically refresh on DOM insertion

exclusive : true, // whether a single accordion content panel should be open at once
collapsible : true, // whether accordion content can be closed
closeNested : false, // whether nested content should be closed when a panel is closed
animateChildren : true, // whether children opacity should be animated

duration : 350, // duration of animation
easing : 'easeOutQuad', // easing equation for animation

duration : 350,
easing : 'easeOutQuad',

onOpen : function(){},
onClose : function(){},
onChange : function(){},
onOpening : function(){}, // callback before open animation
onOpen : function(){}, // callback after open animation
onClosing : function(){}, // callback before closing animation
onClose : function(){}, // callback after closing animation
onChange : function(){}, // callback after closing or opening animation

error: {
method : 'The method you called is not defined'
Expand Down
Loading

0 comments on commit f43e4ea

Please sign in to comment.