$('.follow.button')
@@ -264,13 +301,14 @@ type : 'UI Behavior'
For example you might expect all successful JSON responses to return a top level property signifying the success of the response
{
- success: true
- data: {
- proprietaryData:
+ "success": true,
+ "message": "We've retreived your data from the server"
+ "data": {
+ // payload here
}
}
Your success test recieves the servers json response, and should return true or false on whether the result should be considered successful. Succesful results will trigger onSuccess
unsuccesful results onFailure
but not onError
, this is reserved for responses which return XHR errors.
The success test function recieves the servers json response, and returns whether the result should be considered successful. Succesful results will trigger onSuccess
unsuccesful results onFailure
but not onError
, this is reserved for responses which return XHR errors.
$('.follow.button')
.api({
@@ -336,6 +374,7 @@ type : 'UI Behavior'
$('.follow.button')
+ .api('setting', 'on', 'auto')
.state({
text: {
inactive : 'Follow',
@@ -423,9 +462,238 @@ type : 'UI Behavior'
-
-
Needs to be written still...
+
+
+
+
+
+
+ |
+ Default |
+ Description |
+
+
+
+ on |
+ auto |
+ When API event should occur |
+
+
+ filter |
+
+
+ .disabled
+
+ |
+ Selector filter for elements that should not be triggerable |
+
+
+ stateContext |
+ this (selector/DOM element) |
+ UI state will be applied to this element, defaults to triggering element. |
+
+
+ defaultData |
+ true |
+ Whether to include default data like {value} and {text} |
+
+
+ serializeForm |
+ (true, false) |
+ Whether to serialize closest form and include in request |
+
+
+ throttle |
+ 0 |
+ If a request is pending, additional requests will be throttled by this duration in ms. (Setting above 0 will allow multiple simultaneous requests) |
+
+
+ regExp |
+
+
+ regExp : {
+ required: /\{\$*[A-z0-9]+\}/g,
+ optional: /\{\/\$*[A-z0-9]+\}/g,
+ }
+
+ |
+ Regular expressions used for finding variables in templated urls |
+
+
+
+
+
+
+
+ |
+ Default |
+ Description |
+ Possible Values |
+
+
+
+ action |
+ |
+ Named API action for query, originally specified in $.fn.settings.api |
+ String or false |
+
+
+ url |
+ false |
+ Templated URL for query, will override specified action |
+ String or false |
+
+
+ urlData |
+ false |
+ Variables to use for replacement |
+ |
+
+
+ method |
+ get |
+ Method for transmitting request to server |
+ post, get |
+
+
+ dataType |
+ JSON |
+ Expected data type of response |
+ xml, json, jsonp, script, html, text |
+
+
+ data |
+ {} |
+ POST/GET Data to Send with Request |
+ |
+
+
+ filter |
+
+
+ .disabled
+
+ |
+ Selector filter for elements that should not be triggerable |
+
+
+ stateContext |
+ this (selector/DOM element) |
+ UI state will be applied to this element, defaults to triggering element. |
+
+
+
+
+
+
+
+
+ |
+ Context |
+ Description |
+
+
+
+ onOpen |
+ active content |
+ Callback on element open |
+
+
+ onClose |
+ active content |
+ Callback on element close |
+
+
+ onChange |
+ active content |
+ Callback on element open or close |
+
+
+
+
+
+
+
These settings are native to all modules, and define how the component ties content to DOM attributes, and debugging settings for the module.
+
+
+
+ |
+ Default |
+ Description |
+
+
+
+ name |
+ Accordion |
+ Name used in log statements |
+
+
+ namespace |
+ accordion |
+ Event namespace. Makes sure module teardown does not effect other events attached to an element. |
+
+
+ selector |
+
+
+ selector : {
+ accordion : '.accordion',
+ title : '.title',
+ content : '.content'
+ }
+
+ |
+ Selectors used to find parts of a module |
+
+
+ className |
+
+
+ className : {
+ active : 'active'
+ }
+
+ |
+ Class names used to determine element state |
+
+
+ debug |
+ false |
+ Debug output to console |
+
+
+ performance |
+ false |
+ Show console.table output with performance metrics |
+
+
+ verbose |
+ false |
+ Debug output includes all internal behaviors |
+
+
+ errors |
+
+
+ error : {
+ method : 'The method you called is not defined.'
+ }
+
+ |
+
+
+
diff --git a/server/files/javascript/semantic.js b/server/files/javascript/semantic.js
index 25c55af40..9be832c0e 100755
--- a/server/files/javascript/semantic.js
+++ b/server/files/javascript/semantic.js
@@ -324,7 +324,7 @@ semantic.ready = function() {
$rail = $('
')
.addClass('ui close right rail')
.html($sticky)
- .appendTo($container)
+ .prependTo($container)
;
$followMenu
.accordion({
diff --git a/server/files/stylesheets/semantic.css b/server/files/stylesheets/semantic.css
index eee1d95b1..ce1f93bc3 100755
--- a/server/files/stylesheets/semantic.css
+++ b/server/files/stylesheets/semantic.css
@@ -613,6 +613,9 @@ body#example.hide {
padding: 3em 0em 0em;
-webkit-tap-highlight-color: transparent;
}
+#example .example:last-child {
+ margin-bottom: 5em;
+}
/* Header */
#example .example > h4:first-child {
@@ -1444,7 +1447,7 @@ body.progress.animated .ui.progress .bar {
border-left: 1px solid #DDDDDD;
border-right: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
- padding: 2em 2em 8em;
+ padding: 2em 2em;
z-index: 1;
}
#example .wide.main.container {
diff --git a/src/definitions/behaviors/api.js b/src/definitions/behaviors/api.js
index ddabe6676..f649f1a02 100755
--- a/src/definitions/behaviors/api.js
+++ b/src/definitions/behaviors/api.js
@@ -113,8 +113,8 @@ $.api = $.fn.api = function(parameters) {
return;
}
// determine if an api event already occurred
- if(module.is.loading() && !settings.allowMultiple) {
- module.debug('Request cancelled previous request is still pending');
+ if(module.is.loading() && settings.throttle === 0 ) {
+ module.debug('Cancelling request, previous request is still pending');
return;
}
@@ -181,9 +181,17 @@ $.api = $.fn.api = function(parameters) {
module.verbose('Creating AJAX request with settings', ajaxSettings);
- // request provides a wrapper around xhr
- module.request = module.create.request();
- module.xhr = module.create.xhr();
+ if( !module.is.loading() ) {
+ module.request = module.create.request();
+ module.xhr = module.create.xhr();
+ }
+ else {
+ // throttle additional requests
+ module.timer = setTimeout(function() {
+ module.request = module.create.request();
+ module.xhr = module.create.xhr();
+ }, settings.throttle);
+ }
},
@@ -745,32 +753,29 @@ $.api.settings = {
// event binding
on : 'auto',
filter : '.disabled',
- context : false,
stateContext : false,
// templating
action : false,
url : false,
- regExp : {
- required: /\{\$*[A-z0-9]+\}/g,
- optional: /\{\/\$*[A-z0-9]+\}/g,
- },
-
// data
urlData : {},
-
// ui
defaultData : true,
serializeForm : false,
- throttle : 100,
- allowMultiple : false,
+ throttle : 0,
// state
loadingDuration : 0,
errorDuration : 2000,
+ regExp : {
+ required: /\{\$*[A-z0-9]+\}/g,
+ optional: /\{\/\$*[A-z0-9]+\}/g,
+ },
+
// jQ ajax
method : 'get',
data : {},
diff --git a/src/definitions/collections/grid.less b/src/definitions/collections/grid.less
index 023914e65..283830bf4 100755
--- a/src/definitions/collections/grid.less
+++ b/src/definitions/collections/grid.less
@@ -882,6 +882,13 @@
table-layout: fixed;
width: @tableWidth;
}
+.ui[class*="equal height"].relaxed.grid {
+ width: @relaxedTableWidth;
+}
+.ui[class*="equal height"][class*="very relaxed"].grid {
+ width: @veryRelaxedTableWidth;
+}
+
.ui[class*="equal height"].grid > .row,
.ui[class*="equal height"].row {
display: table;
diff --git a/src/themes/packages/default/collections/grid.variables b/src/themes/packages/default/collections/grid.variables
index e15561b3c..b3b64861d 100755
--- a/src/themes/packages/default/collections/grid.variables
+++ b/src/themes/packages/default/collections/grid.variables
@@ -18,9 +18,9 @@
@gutterWidth: 2rem;
@rowSpacing: 2rem;
+@tableWidth: ~"calc(100% + "@gutterWidth~")";
@columnMaxImageWidth: 100%;
-@tableWidth: ~"calc(100% + "@gutterWidth~")";
/*******************************
Variations
@@ -53,6 +53,10 @@
@relaxedGutterWidth: 3rem;
@veryRelaxedGutterWidth: 5rem;
+@relaxedTableWidth: ~"calc(100% + "@relaxedGutterWidth~")";
+@veryRelaxedTableWidth: ~"calc(100% + "@veryRelaxedGutterWidth~")";
+
+
/*--------------
Divided
---------------*/