Skip to content

Commit c6c159e

Browse files
committed
Assets for Semantic UI 2.1.7
1 parent 71c7373 commit c6c159e

12 files changed

Lines changed: 136 additions & 56 deletions

File tree

assets/javascripts/semantic_ui/definitions/behaviors/api.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ $.api = $.fn.api = function(parameters) {
213213

214214
// replace variables
215215
url = module.add.urlData( url );
216-
217216
// missing url parameters
218217
if( !url && !module.is.mocked()) {
219218
return;
220219
}
221220

221+
requestSettings.url = settings.base + url;
222222

223223
// look for jQuery ajax parameters in settings
224224
ajaxSettings = $.extend(true, {}, settings, {
@@ -280,7 +280,7 @@ $.api = $.fn.api = function(parameters) {
280280
return $module.is('form') || $context.is('form');
281281
},
282282
mocked: function() {
283-
return (settings.mockResponse || settings.mockResponseAsync);
283+
return (settings.mockResponse || settings.mockResponseAsync || settings.response || settings.responseAsync);
284284
},
285285
input: function() {
286286
return $module.is('input');
@@ -592,9 +592,11 @@ $.api = $.fn.api = function(parameters) {
592592
mockedXHR: function () {
593593
var
594594
// xhr does not simulate these properties of xhr but must return them
595-
textStatus = false,
596-
status = false,
597-
httpMessage = false,
595+
textStatus = false,
596+
status = false,
597+
httpMessage = false,
598+
responder = settings.mockResponse || settings.response,
599+
asyncResponder = settings.mockResponseAsync || settings.responseAsync,
598600
asyncCallback,
599601
response,
600602
mockedXHR
@@ -606,19 +608,19 @@ $.api = $.fn.api = function(parameters) {
606608
.fail(module.event.xhr.fail)
607609
;
608610

609-
if(settings.mockResponse) {
610-
if( $.isFunction(settings.mockResponse) ) {
611-
module.debug('Using mocked callback returning response', settings.mockResponse);
612-
response = settings.mockResponse.call(context, settings);
611+
if(responder) {
612+
if( $.isFunction(responder) ) {
613+
module.debug('Using specified synchronous callback', responder);
614+
response = responder.call(context, requestSettings);
613615
}
614616
else {
615-
module.debug('Using specified response', settings.mockResponse);
616-
response = settings.mockResponse;
617+
module.debug('Using settings specified response', responder);
618+
response = responder;
617619
}
618620
// simulating response
619621
mockedXHR.resolveWith(context, [ response, textStatus, { responseText: response }]);
620622
}
621-
else if( $.isFunction(settings.mockResponseAsync) ) {
623+
else if( $.isFunction(asyncResponder) ) {
622624
asyncCallback = function(response) {
623625
module.debug('Async callback returned response', response);
624626

@@ -629,8 +631,8 @@ $.api = $.fn.api = function(parameters) {
629631
mockedXHR.rejectWith(context, [{ responseText: response }, status, httpMessage]);
630632
}
631633
};
632-
module.debug('Using async mocked response', settings.mockResponseAsync);
633-
settings.mockResponseAsync.call(context, settings, asyncCallback);
634+
module.debug('Using specified async response callback', asyncResponder);
635+
asyncResponder.call(context, requestSettings, asyncCallback);
634636
}
635637
return mockedXHR;
636638
},
@@ -722,8 +724,8 @@ $.api = $.fn.api = function(parameters) {
722724
module.error(error.noReturnedValue);
723725
}
724726
return (runSettings !== undefined)
725-
? runSettings
726-
: settings
727+
? $.extend(true, {}, runSettings)
728+
: $.extend(true, {}, settings)
727729
;
728730
},
729731
urlEncodedValue: function(value) {
@@ -1066,6 +1068,10 @@ $.api.settings = {
10661068
mockResponse : false,
10671069
mockResponseAsync : false,
10681070

1071+
// aliases for mock
1072+
response : false,
1073+
responseAsync : false,
1074+
10691075
// callbacks before request
10701076
beforeSend : function(settings) { return settings; },
10711077
beforeXHR : function(xhr) {},

assets/javascripts/semantic_ui/definitions/modules/checkbox.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ $.fn.checkbox = function(parameters) {
268268
}
269269
module.debug('Enabling checkbox');
270270
module.set.enabled();
271-
settings.onEnable.call(input);
271+
settings.onEnabled.call(input);
272272
},
273273

274274
disable: function() {
@@ -278,7 +278,7 @@ $.fn.checkbox = function(parameters) {
278278
}
279279
module.debug('Disabling checkbox');
280280
module.set.disabled();
281-
settings.onDisable.call(input);
281+
settings.onDisabled.call(input);
282282
},
283283

284284
get: {
@@ -781,8 +781,8 @@ $.fn.checkbox.settings = {
781781
onDeterminate : function() {},
782782
onIndeterminate : function() {},
783783

784-
onEnabled : function(){},
785-
onDisabled : function(){},
784+
onEnable : function(){},
785+
onDisable : function(){},
786786

787787
className : {
788788
checked : 'checked',

assets/javascripts/semantic_ui/definitions/modules/popup.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ $.fn.popup = function(parameters) {
841841
module.remove.attempts();
842842
module.remove.loading();
843843
module.reset();
844+
settings.onUnplaceable.call($popup, element);
844845
return false;
845846
}
846847
}
@@ -1011,13 +1012,13 @@ $.fn.popup = function(parameters) {
10111012
return $module.hasClass(className.active);
10121013
},
10131014
animating: function() {
1014-
return ( $popup && $popup.hasClass(className.animating) );
1015+
return ($popup !== undefined && $popup.hasClass(className.animating) );
10151016
},
10161017
fluid: function() {
1017-
return ( $popup && $popup.hasClass(className.fluid));
1018+
return ($popup !== undefined && $popup.hasClass(className.fluid));
10181019
},
10191020
visible: function() {
1020-
return $popup && $popup.hasClass(className.visible);
1021+
return ($popup !== undefined && $popup.hasClass(className.visible));
10211022
},
10221023
dropdown: function() {
10231024
return $module.hasClass(className.dropdown);
@@ -1244,6 +1245,9 @@ $.fn.popup.settings = {
12441245
// callback before hide animation
12451246
onHide : function(){},
12461247

1248+
// callback when popup cannot be positioned in visible screen
1249+
onUnplaceable: function(){},
1250+
12471251
// callback after hide animation
12481252
onHidden : function(){},
12491253

assets/javascripts/semantic_ui/definitions/modules/search.js

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,29 @@ $.fn.search = function(parameters) {
134134
},
135135
blur: function(event) {
136136
var
137-
pageLostFocus = (document.activeElement === this)
137+
pageLostFocus = (document.activeElement === this),
138+
callback = function() {
139+
module.cancel.query();
140+
module.remove.focus();
141+
module.timer = setTimeout(module.hideResults, settings.hideDelay);
142+
}
138143
;
139-
if(!pageLostFocus && !module.resultsClicked) {
140-
module.cancel.query();
141-
module.remove.focus();
142-
module.timer = setTimeout(module.hideResults, settings.hideDelay);
144+
if(pageLostFocus) {
145+
return;
146+
}
147+
if(module.resultsClicked) {
148+
module.debug('Determining if user action caused search to close');
149+
$module
150+
.one('click', selector.results, function(event) {
151+
if( !module.is.animating() && !module.is.hidden() ) {
152+
callback();
153+
}
154+
})
155+
;
156+
}
157+
else {
158+
module.debug('Input blurred without user action, closing results');
159+
callback();
143160
}
144161
},
145162
result: {
@@ -298,6 +315,12 @@ $.fn.search = function(parameters) {
298315
},
299316

300317
is: {
318+
animating: function() {
319+
return $results.hasClass(className.animating);
320+
},
321+
hidden: function() {
322+
return $results.hasClass(className.hidden);
323+
},
301324
empty: function() {
302325
return ($results.html() === '');
303326
},
@@ -1106,12 +1129,14 @@ $.fn.search.settings = {
11061129
onResultsClose : function(){},
11071130

11081131
className: {
1109-
active : 'active',
1110-
empty : 'empty',
1111-
focus : 'focus',
1112-
loading : 'loading',
1113-
results : 'results',
1114-
pressed : 'down'
1132+
animating : 'animating',
1133+
active : 'active',
1134+
empty : 'empty',
1135+
focus : 'focus',
1136+
hidden : 'hidden',
1137+
loading : 'loading',
1138+
results : 'results',
1139+
pressed : 'down'
11151140
},
11161141

11171142
error : {

assets/javascripts/semantic_ui/definitions/modules/transition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ $.fn.transition.settings = {
10621062

10631063
// possible errors
10641064
error: {
1065-
noAnimation : 'There is no css animation matching the one you specified. Please make sure your css is vendor prefixed, and you have included transition css.',
1065+
noAnimation : 'Element is no longer attached to DOM. Unable to animate.',
10661066
repeated : 'That animation is already occurring, cancelling repeated animation',
10671067
method : 'The method you called is not defined',
10681068
support : 'This browser does not support CSS animations'

assets/stylesheets/semantic_ui/definitions/collections/form.less

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,6 @@
609609
position: relative;
610610
cursor: default;
611611
point-events: none;
612-
text-shadow: none !important;
613-
color: transparent !important;
614-
transition: all 0s linear;
615-
z-index: 100;
616612
}
617613
.ui.loading.form:before {
618614
position: absolute;

assets/stylesheets/semantic_ui/definitions/collections/menu.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,8 @@ Floated Menu / Item
646646
}
647647

648648
/* Coupling with segment for attachment */
649-
.ui.tabular.menu + .bottom.attached.segment {
649+
.ui.tabular.menu + .attached:not(.top).segment,
650+
.ui.tabular.menu + .attached:not(.top).segment + .attached:not(.top).segment {
650651
border-top: none;
651652
margin: 0px;
652653
width: 100%;

assets/stylesheets/semantic_ui/definitions/elements/flag.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ i.flag:not(.icon) {
5555
i.flag:not(.icon):before {
5656
display: inline-block;
5757
content: '';
58-
background: asset-url(@spritePath) no-repeat 0px 0px;
58+
background: asset-url(@spritePath) no-repeat -108px -1976px;
5959
width: @width;
6060
height: @height;
6161
}

assets/stylesheets/semantic_ui/definitions/modules/search.less

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,40 @@
285285
*******************************/
286286

287287
/*--------------
288-
Categories
288+
Selection
289+
---------------*/
290+
291+
.ui.search.selection .prompt {
292+
border-radius: @selectionPromptBorderRadius;
293+
}
294+
295+
/* Remove input */
296+
.ui.search.selection > .icon.input > .remove.icon {
297+
pointer-events: none;
298+
position: absolute;
299+
left: auto;
300+
opacity: 0;
301+
color: @selectionCloseIconColor;
302+
top: @selectionCloseTop;
303+
right: @selectionCloseRight;
304+
transition: @selectionCloseTransition;
305+
}
306+
.ui.search.selection > .icon.input > .active.remove.icon {
307+
cursor: pointer;
308+
opacity: @selectionCloseIconOpacity;
309+
pointer-events: auto;
310+
}
311+
.ui.search.selection > .icon.input:not([class*="left icon"]) > .icon ~ .remove.icon {
312+
right: @selectionCloseIconInputRight;
313+
}
314+
.ui.search.selection > .icon.input > .remove.icon:hover {
315+
opacity: @selectionCloseIconHoverOpacity;
316+
color: @selectionCloseIconHoverColor;
317+
}
318+
319+
320+
/*--------------
321+
Category
289322
---------------*/
290323

291324
.ui.category.search .results {

assets/stylesheets/semantic_ui/definitions/modules/sidebar.less

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
/* GPU Layers for Child Elements */
5959
.ui.sidebar > * {
6060
backface-visibility: hidden;
61-
transform: rotateZ(0deg);
6261
}
6362

6463

@@ -275,14 +274,14 @@ html.ios body {
275274
---------------*/
276275

277276
/* Left / Right */
278-
.ui[class*="very thin"].left.sidebar,
279-
.ui[class*="very thin"].right.sidebar {
280-
width: @veryThinWidth;
281-
}
282277
.ui.thin.left.sidebar,
283278
.ui.thin.right.sidebar {
284279
width: @thinWidth;
285280
}
281+
.ui[class*="very thin"].left.sidebar,
282+
.ui[class*="very thin"].right.sidebar {
283+
width: @veryThinWidth;
284+
}
286285
.ui.left.sidebar,
287286
.ui.right.sidebar {
288287
width: @width;
@@ -297,14 +296,14 @@ html.ios body {
297296
}
298297

299298
/* Left Visible */
300-
.ui.visible[class*="very thin"].left.sidebar ~ .fixed,
301-
.ui.visible[class*="very thin"].left.sidebar ~ .pusher {
302-
transform: translate3d(@veryThinWidth, 0, 0);
303-
}
304299
.ui.visible.thin.left.sidebar ~ .fixed,
305300
.ui.visible.thin.left.sidebar ~ .pusher {
306301
transform: translate3d(@thinWidth, 0, 0);
307302
}
303+
.ui.visible[class*="very thin"].left.sidebar ~ .fixed,
304+
.ui.visible[class*="very thin"].left.sidebar ~ .pusher {
305+
transform: translate3d(@veryThinWidth, 0, 0);
306+
}
308307
.ui.visible.wide.left.sidebar ~ .fixed,
309308
.ui.visible.wide.left.sidebar ~ .pusher {
310309
transform: translate3d(@wideWidth, 0, 0);
@@ -315,14 +314,14 @@ html.ios body {
315314
}
316315

317316
/* Right Visible */
318-
.ui.visible[class*="very thin"].right.sidebar ~ .fixed,
319-
.ui.visible[class*="very thin"].right.sidebar ~ .pusher {
320-
transform: translate3d(-@veryThinWidth, 0, 0);
321-
}
322317
.ui.visible.thin.right.sidebar ~ .fixed,
323318
.ui.visible.thin.right.sidebar ~ .pusher {
324319
transform: translate3d(-@thinWidth, 0, 0);
325320
}
321+
.ui.visible[class*="very thin"].right.sidebar ~ .fixed,
322+
.ui.visible[class*="very thin"].right.sidebar ~ .pusher {
323+
transform: translate3d(-@veryThinWidth, 0, 0);
324+
}
326325
.ui.visible.wide.right.sidebar ~ .fixed,
327326
.ui.visible.wide.right.sidebar ~ .pusher {
328327
transform: translate3d(-@wideWidth, 0, 0);

0 commit comments

Comments
 (0)