Skip to content

Commit 2d9ddb2

Browse files
committed
Merge branch 'next' of github.com:Semantic-Org/Semantic-UI-Docs into next
2 parents 8fcf975 + 2484310 commit 2d9ddb2

22 files changed

Lines changed: 1422 additions & 607 deletions

docpad.coffee

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ docpadConfig = {
2929
# Here are some old site urls that you would like to redirect from
3030
oldUrls: [],
3131

32+
<<<<<<< HEAD
3233
version: "2.2.10",
34+
=======
35+
version: "2.2.8",
36+
>>>>>>> 2484310f15aa385c7bb5e7e668af728132955b76
3337

3438
branch: "master",
3539

server/documents/behaviors/form.html.eco

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,51 @@ type : 'UI Behavior'
282282
</form>
283283
</div>
284284

285+
<div class="prompt example">
286+
<h4 class="ui header">
287+
Validating Programmatically
288+
<div class="ui teal label">Updated in 2.2.8</div>
289+
</h4>
290+
<p>Form validation provides additional behaviors to programmatically trigger validation for either the form or an individual field, and check validation on the form or individual fields.</p>
291+
<p>Please see the <a href="#behaviors">behaviors section</a> for an explanation on syntax.</p>
292+
<table class="ui celled sortable basic table segment">
293+
<tbody>
294+
<tr>
295+
<td class="four wide"><b>validate form</b></td>
296+
<td>Validates entire form and displays errors if necessary</td>
297+
</tr>
298+
<tr>
299+
<td class="four wide"><b>is valid</b></td>
300+
<td>Returns whether a form is valid</td>
301+
</tr>
302+
<tr>
303+
<td class="four wide"><b>is valid(fieldName)</b></td>
304+
<td>Returns whether a field in a form is valid (does not update UI)</td>
305+
</tr>
306+
<tr>
307+
<td class="four wide"><b>validate field(fieldName)</b></td>
308+
<td>Validates a particular field and displays errors if necessary</td>
309+
</tr>
310+
</tbody>
311+
</table>
312+
<div class="ignored code">
313+
$('.ui.form')
314+
.form({
315+
fields: [
316+
email: 'empty',
317+
name: 'empty'
318+
]
319+
})
320+
;
321+
if( $('.ui.form').form('is valid', 'email')) {
322+
// email is valid
323+
}
324+
if( $('.ui.form').form('is valid') {
325+
// form is valid (both email and name)
326+
}
327+
</div>
328+
</div>
329+
285330
<h2 class="ui dividing header">Rules</h2>
286331

287332
<div class="no example">
@@ -838,7 +883,7 @@ type : 'UI Behavior'
838883
</div>
839884
<div class="field">
840885
<label>E-mail</label>
841-
<input name="email" type="text" value="jack@foo">
886+
<input name="email" type="text" value="jack">
842887
</div>
843888
</div>
844889
<div class="two fields">
@@ -1696,7 +1741,7 @@ type : 'UI Behavior'
16961741
</div>
16971742

16981743
<div class="ui tab" data-tab="settings">
1699-
<h2 class="ui dividing header">Behavior</h2>
1744+
<h2 class="ui dividing header">Behaviors</h2>
17001745

17011746
All the following behaviors can be called using the syntax
17021747

@@ -1713,13 +1758,17 @@ type : 'UI Behavior'
17131758
<td>is valid</td>
17141759
<td>Returns true/false whether a form passes its validation rules</td>
17151760
</tr>
1761+
<tr>
1762+
<td>is valid(fieldName)</td>
1763+
<td>Returns true/false whether a field passes its validation rules</td>
1764+
</tr>
17161765
<tr>
17171766
<td>validate form</td>
1718-
<td>Validates form and calls onSuccess or onFailure</td>
1767+
<td>Validates form, updates UI, and calls onSuccess or onFailure</td>
17191768
</tr>
17201769
<tr>
1721-
<td>get change event</td>
1722-
<td>gets browser property change event</td>
1770+
<td>validate field(fieldName)</td>
1771+
<td>Validates field, updates UI, and calls onSuccess or onFailure</td>
17231772
</tr>
17241773
<tr>
17251774
<td>get field(id)</td>

server/documents/behaviors/visibility.html.eco

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,28 @@ type : 'UI Behavior'
267267
</tr>
268268
</thead>
269269
<tbody>
270+
<tr>
271+
<td>
272+
onOnScreen
273+
</td>
274+
<td>
275+
Any part of element is in current scroll viewport
276+
</td>
277+
<td>
278+
<div class="code" data-type="javascript">screen.bottom >= element.top && screen.bottom <= element.bottom</div>
279+
</td>
280+
</tr>
281+
<tr>
282+
<td>
283+
onOffScreen
284+
</td>
285+
<td>
286+
No part of element is in current scroll viewport
287+
</td>
288+
<td>
289+
<div class="code" data-type="javascript">screen.bottom <= element.top || screen.top >= element.bottom</div>
290+
</td>
291+
</tr>
270292
<tr>
271293
<td>
272294
onTopVisible
@@ -556,7 +578,7 @@ type : 'UI Behavior'
556578
</div>
557579
</div>
558580

559-
<div class="visibility example">
581+
<div class="visibility shown example">
560582
<h4 class="ui header">Lazy Loading Images</h4>
561583
<p>Visibility includes several shortcuts for setting up common visibility events. Using the setting <code>type: 'image'</code> will automatically attach events to an images <code>topVisible</code> to load the contents of <code>data-src</code> as <code>src</code>.</p>
562584

server/documents/collections/menu.html.eco

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -717,16 +717,6 @@ themes : ['Default', 'Chubby', 'GitHub', 'Material']
717717
</div>
718718

719719

720-
<div class="example">
721-
<h4 class="ui header">Down</h4>
722-
<p>A menu item can be pressed in</p>
723-
<div class="ui compact menu">
724-
<div class="down item">
725-
Link
726-
</div>
727-
</div>
728-
</div>
729-
730720
<div class="example">
731721
<h4 class="ui header">Active</h4>
732722
<p>A menu item can be active</p>

server/documents/elements/container.html.eco

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,12 @@ themes : ['Default']
6666
<td>Fluid</td>
6767
<td>Fluid</td>
6868
</tr>
69-
<!-- <tr>
69+
<tr>
7070
<td>Variable</td>
7171
<td><code>$largestMobileScreen</code></td>
7272
<td><code>$mobileBreakpoint</code></td>
7373
<td><code>$smallMonitorBreakpoint</code></td>
7474
<td><code>$largeMonitorBreakpoint</code></td>
75-
</tr> -->
76-
<tr>
77-
<td class="single line">Responsive Visibility</td>
78-
<td><code>mobile only</code></td>
79-
<td><code>tablet only</code></td>
80-
<td><code>small monitor only</code></td>
81-
<td><code>large monitor only</code></td>
8275
</tr>
8376
<tr>
8477
<td>Device Width</td>
@@ -89,6 +82,10 @@ themes : ['Default']
8982
</tr>
9083
</tbody>
9184
</table>
85+
<h3 class="ui header">Responsive Visibility</h3>
86+
<p>Since variations in Semantic UI are only assigned in the scope of components, there are no "free floating" responsive class names, however some components include responsive variations to help ease responsive design. <a href=href="/collections/grid.html#device-visibility">Grid</a> for example, includes responsive classes for hiding or showing <code>column</code>, <code>row</code> based on device type.</p>
87+
88+
<a href="/collections/grid.html#device-visibility" class="ui secondary button">See grid responsive variations <i class="right chevron icon"></i></a>
9289

9390
<h3 class="ui header">Determining Maximum Widths</h3>
9491

0 commit comments

Comments
 (0)