Skip to content

Commit 7eb7c95

Browse files
committed
Fixes Semantic-UI/#5121 jQuery AJAX settings not documented
1 parent bf01db3 commit 7eb7c95

2 files changed

Lines changed: 18 additions & 46 deletions

File tree

server/documents/behaviors/api.html.eco

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,14 @@ type : 'UI Behavior'
970970
</h2>
971971

972972
<h4 class="ui header">
973-
Behavior
973+
AJAX
974+
</h4>
975+
<div class="ui info message">
976+
You can pass in any standard <a href="http://api.jquery.com/jquery.ajax/">jQuery AJAX setting</a> like <code>timeout</code> or <code>contentType</code> to API's settings and it will be automatically passed to the request's AJAX call.
977+
</div>
978+
979+
<h4 class="ui header">
980+
API
974981
</h4>
975982
<table class="ui sortable celled definition table">
976983
<thead>

server/documents/hotfix.html.eco

100644100755
Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,21 @@ title : 'Test Page'
77
type : 'Library'
88
---
99
<div class="ui container">
10-
<div class="ui basic segment">
11-
1. After "First" tab is clicked, click the "ClickMe" button. Alert will appear<br />
12-
2. <b>BUG:</b> When "First" tab is clicked on again, button stops working. Changing <i>cacheType</i> doesnt change anything!<br />
13-
3. <b>The goal is to run JS once and then leave it be</b>. So scripts must be evaluated once and tab should not reload, if focused on again.
10+
<div class="ui menu">
11+
<div class="ui category search item">
12+
<div class="ui transparent icon input">
13+
<input class="prompt" type="text" placeholder="Search animals..." value="pizza">
14+
<i class="search link icon"></i>
15+
</div>
16+
<div class="results"></div>
17+
</div>
1418
</div>
15-
16-
<div class="ui top attached tabular menu">
17-
<a class="active item" data-tab="first">First</a>
18-
<a class="item" data-tab="second">Second</a>
19-
</div>
20-
<div class="ui bottom attached active tab segment" data-tab="first">
21-
22-
</div>
23-
<div class="ui bottom attached tab segment" data-tab="second">
24-
19+
<div class="ui segment">
20+
<p></p>
2521
</div>
2622
</div>
2723
<script>
2824
$(document).ready(function() {
29-
var firstTabContent = "<div id='testfirst'>One&nbsp;<button>ClickMe</button></div> \n" +
30-
"<script type='text/javascript'>\n" +
31-
" $(function() { $('button').click(function() { alert(1) }); $('#testfirst').append('<div>dynamically appended div <b>(will disappear if tab is clicked again!)</b> ' + (new Date()).getTime() + '</div>') });\n" +
32-
"</scr" + "ipt>";
33-
34-
$('.menu .item')
35-
.tab({
36-
cache: true,
37-
cacheType: 'DOM',
38-
evaluateScripts: true,
39-
onFirstLoad: function(tabPath, parameterArray, historyEvent) {
40-
console.log('Initialized tab: ' + tabPath);
41-
},
42-
onLoad: function(tabPath, parameterArray, historyEvent) { //tab selected
43-
console.log('Selected tab: ' + tabPath);
44-
},
45-
apiSettings: {
46-
loadingDuration : 300,
47-
mockResponse : function(settings) {
48-
var response = {
49-
first : firstTabContent,
50-
51-
second : 'Two',
52-
53-
third : 'Three'
54-
};
55-
56-
return response[settings.urlData.tab];
57-
}
58-
}
59-
});
6025
});
6126

6227
</script>

0 commit comments

Comments
 (0)