Skip to content

Commit 45a3643

Browse files
Updated distribution to version 2.0.0
1 parent 99bc824 commit 45a3643

147 files changed

Lines changed: 33633 additions & 19840 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/accordion.css

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*!
2-
* # Semantic UI 1.12.3 - Accordion
2+
* # Semantic UI 2.0.0 - Accordion
33
* http://github.com/semantic-org/semantic-ui/
44
*
55
*
6-
* Copyright 2014 Contributors
6+
* Copyright 2015 Contributors
77
* Released under the MIT license
88
* http://opensource.org/licenses/MIT
99
*
@@ -17,7 +17,6 @@
1717
.ui.accordion,
1818
.ui.accordion .accordion {
1919
max-width: 100%;
20-
font-size: 1em;
2120
}
2221
.ui.accordion .accordion {
2322
margin: 1em 0em 0em;
@@ -35,7 +34,7 @@
3534
padding: 0.5em 0em;
3635
font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
3736
font-size: 1em;
38-
color: rgba(0, 0, 0, 0.8);
37+
color: rgba(0, 0, 0, 0.87);
3938
}
4039

4140
/* Content */
@@ -47,7 +46,7 @@
4746
/* Default Styling */
4847
.ui.accordion:not(.styled) .title ~ .content:not(.ui),
4948
.ui.accordion:not(.styled) .accordion .title ~ .content:not(.ui) {
50-
margin: 0em;
49+
margin: '';
5150
padding: 0.5em 0em 1em;
5251
}
5352
.ui.accordion:not(.styled) .title ~ .content:not(.ui):last-child {
@@ -65,8 +64,8 @@
6564
margin: 0em 0.25rem 0em 0rem;
6665
padding: 0em;
6766
font-size: 1em;
68-
-webkit-transition: -webkit-transform 0.2s ease, opacity 0.2s ease;
69-
transition: transform 0.2s ease, opacity 0.2s ease;
67+
-webkit-transition: -webkit-transform 0.1s ease, opacity 0.1s ease;
68+
transition: transform 0.1s ease, opacity 0.1s ease;
7069
vertical-align: baseline;
7170
-webkit-transform: none;
7271
-ms-transform: none;
@@ -85,7 +84,7 @@
8584
}
8685
.ui.accordion.menu .item .title > .dropdown.icon {
8786
float: right;
88-
margin: 0.165em 0em 0em 1em;
87+
margin: 0.21425em 0em 0em 1em;
8988
-webkit-transform: rotate(180deg);
9089
-ms-transform: rotate(180deg);
9190
transform: rotate(180deg);
@@ -129,19 +128,19 @@
129128
}
130129
.ui.styled.accordion,
131130
.ui.styled.accordion .accordion {
132-
border-radius: 0.2857rem;
131+
border-radius: 0.28571429rem;
133132
background: #ffffff;
134-
box-shadow: 0px 1px 2px 0 rgba(0, 0, 0, 0.05), 0px 0px 0px 1px rgba(39, 41, 43, 0.15);
133+
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15);
135134
}
136135
.ui.styled.accordion .title,
137136
.ui.styled.accordion .accordion .title {
138137
margin: 0em;
139138
padding: 0.75em 1em;
140139
color: rgba(0, 0, 0, 0.4);
141140
font-weight: bold;
142-
border-top: 1px solid rgba(39, 41, 43, 0.15);
143-
-webkit-transition: background 0.2s ease, color 0.2s ease;
144-
transition: background 0.2s ease, color 0.2s ease;
141+
border-top: 1px solid rgba(34, 36, 38, 0.15);
142+
-webkit-transition: background 0.1s ease, color 0.1s ease;
143+
transition: background 0.1s ease, color 0.1s ease;
145144
}
146145
.ui.styled.accordion > .title:first-child,
147146
.ui.styled.accordion .accordion .title:first-child {
@@ -165,22 +164,22 @@
165164
.ui.styled.accordion .accordion .title:hover,
166165
.ui.styled.accordion .accordion .active.title {
167166
background: transparent;
168-
color: rgba(0, 0, 0, 0.8);
167+
color: rgba(0, 0, 0, 0.87);
169168
}
170169
.ui.styled.accordion .accordion .title:hover,
171170
.ui.styled.accordion .accordion .active.title {
172171
background: transparent;
173-
color: rgba(0, 0, 0, 0.8);
172+
color: rgba(0, 0, 0, 0.87);
174173
}
175174

176175
/* Active */
177176
.ui.styled.accordion .active.title {
178177
background: transparent;
179-
color: rgba(0, 0, 0, 0.8);
178+
color: rgba(0, 0, 0, 0.95);
180179
}
181180
.ui.styled.accordion .accordion .active.title {
182181
background: transparent;
183-
color: rgba(0, 0, 0, 0.8);
182+
color: rgba(0, 0, 0, 0.95);
184183
}
185184

186185

@@ -218,7 +217,7 @@
218217
---------------*/
219218

220219
.ui.inverted.accordion .title:not(.ui) {
221-
color: #ffffff;
220+
color: rgba(255, 255, 255, 0.9);
222221
}
223222

224223

components/accordion.js

Lines changed: 67 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*!
2-
* # Semantic UI 1.12.3 - Accordion
2+
* # Semantic UI 2.0.0 - Accordion
33
* http://github.com/semantic-org/semantic-ui/
44
*
55
*
6-
* Copyright 2014 Contributors
6+
* Copyright 2015 Contributors
77
* Released under the MIT license
88
* http://opensource.org/licenses/MIT
99
*
@@ -105,7 +105,7 @@ $.fn.accordion = function(parameters) {
105105
events: function() {
106106
module.debug('Binding delegated events');
107107
$module
108-
.on('click' + eventNamespace, selector.trigger, module.event.click)
108+
.on(settings.on + eventNamespace, selector.trigger, module.event.click)
109109
;
110110
}
111111
},
@@ -153,54 +153,59 @@ $.fn.accordion = function(parameters) {
153153
$activeContent = $activeTitle.next($content),
154154
isAnimating = $activeContent.hasClass(className.animating),
155155
isActive = $activeContent.hasClass(className.active),
156-
isUnopen = (!isActive && !isAnimating)
156+
isOpen = (isActive || isAnimating)
157157
;
158-
if(isUnopen) {
159-
module.debug('Opening accordion content', $activeTitle);
160-
if(settings.exclusive) {
161-
module.closeOthers.call($activeTitle);
158+
if(isOpen) {
159+
module.debug('Accordion already open, skipping', $activeContent);
160+
return;
161+
}
162+
module.debug('Opening accordion content', $activeTitle);
163+
settings.onOpening.call($activeContent);
164+
if(settings.exclusive) {
165+
module.closeOthers.call($activeTitle);
166+
}
167+
$activeTitle
168+
.addClass(className.active)
169+
;
170+
$activeContent
171+
.stop(true, true)
172+
.addClass(className.animating)
173+
;
174+
if(settings.animateChildren) {
175+
if($.fn.transition !== undefined && $module.transition('is supported')) {
176+
$activeContent
177+
.children()
178+
.transition({
179+
animation : 'fade in',
180+
queue : false,
181+
useFailSafe : true,
182+
debug : settings.debug,
183+
verbose : settings.verbose,
184+
duration : settings.duration
185+
})
186+
;
162187
}
163-
$activeTitle
164-
.addClass(className.active)
165-
;
166-
$activeContent.addClass(className.animating);
167-
if(settings.animateChildren) {
168-
if($.fn.transition !== undefined && $module.transition('is supported')) {
169-
$activeContent
170-
.children()
171-
.transition({
172-
animation : 'fade in',
173-
queue : false,
174-
useFailSafe : true,
175-
debug : settings.debug,
176-
verbose : settings.verbose,
177-
duration : settings.duration
178-
})
179-
;
180-
}
181-
else {
182-
$activeContent
183-
.children()
184-
.stop(true)
185-
.animate({
186-
opacity: 1
187-
}, settings.duration, module.resetOpacity)
188-
;
189-
}
188+
else {
189+
$activeContent
190+
.children()
191+
.stop(true, true)
192+
.animate({
193+
opacity: 1
194+
}, settings.duration, module.resetOpacity)
195+
;
190196
}
191-
$activeContent
192-
.stop(true)
193-
.slideDown(settings.duration, settings.easing, function() {
194-
$activeContent
195-
.removeClass(className.animating)
196-
.addClass(className.active)
197-
;
198-
module.reset.display.call(this);
199-
settings.onOpen.call(this);
200-
settings.onChange.call(this);
201-
})
202-
;
203197
}
198+
$activeContent
199+
.slideDown(settings.duration, settings.easing, function() {
200+
$activeContent
201+
.removeClass(className.animating)
202+
.addClass(className.active)
203+
;
204+
module.reset.display.call(this);
205+
settings.onOpen.call(this);
206+
settings.onChange.call(this);
207+
})
208+
;
204209
},
205210

206211
close: function(query) {
@@ -218,10 +223,12 @@ $.fn.accordion = function(parameters) {
218223
;
219224
if((isActive || isOpening) && !isClosing) {
220225
module.debug('Closing accordion content', $activeContent);
226+
settings.onClosing.call($activeContent);
221227
$activeTitle
222228
.removeClass(className.active)
223229
;
224230
$activeContent
231+
.stop(true, true)
225232
.addClass(className.animating)
226233
;
227234
if(settings.animateChildren) {
@@ -241,15 +248,14 @@ $.fn.accordion = function(parameters) {
241248
else {
242249
$activeContent
243250
.children()
244-
.stop(true)
251+
.stop(true, true)
245252
.animate({
246253
opacity: 0
247254
}, settings.duration, module.resetOpacity)
248255
;
249256
}
250257
}
251258
$activeContent
252-
.stop(true)
253259
.slideUp(settings.duration, settings.easing, function() {
254260
$activeContent
255261
.removeClass(className.animating)
@@ -291,6 +297,10 @@ $.fn.accordion = function(parameters) {
291297
$openTitles
292298
.removeClass(className.active)
293299
;
300+
$openContents
301+
.removeClass(className.animating)
302+
.stop(true, true)
303+
;
294304
if(settings.animateChildren) {
295305
if($.fn.transition !== undefined && $module.transition('is supported')) {
296306
$openContents
@@ -307,15 +317,14 @@ $.fn.accordion = function(parameters) {
307317
else {
308318
$openContents
309319
.children()
310-
.stop()
320+
.stop(true, true)
311321
.animate({
312322
opacity: 0
313323
}, settings.duration, module.resetOpacity)
314324
;
315325
}
316326
}
317327
$openContents
318-
.stop()
319328
.slideUp(settings.duration , settings.easing, function() {
320329
$(this).removeClass(className.active);
321330
module.reset.display.call(this);
@@ -422,7 +431,7 @@ $.fn.accordion = function(parameters) {
422431
});
423432
}
424433
clearTimeout(module.performance.timer);
425-
module.performance.timer = setTimeout(module.performance.display, 100);
434+
module.performance.timer = setTimeout(module.performance.display, 500);
426435
},
427436
display: function() {
428437
var
@@ -534,9 +543,11 @@ $.fn.accordion.settings = {
534543
namespace : 'accordion',
535544

536545
debug : false,
537-
verbose : true,
546+
verbose : false,
538547
performance : true,
539548

549+
on : 'click',
550+
540551
exclusive : true,
541552
collapsible : true,
542553
closeNested : false,
@@ -545,7 +556,10 @@ $.fn.accordion.settings = {
545556
duration : 350,
546557
easing : 'easeOutQuad',
547558

559+
560+
onOpening : function(){},
548561
onOpen : function(){},
562+
onClosing : function(){},
549563
onClose : function(){},
550564
onChange : function(){},
551565

0 commit comments

Comments
 (0)