Skip to content

Commit

Permalink
Fix issues with ajax tabs not obeying cache #2493
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Jul 6, 2015
1 parent cf19a3e commit 7a53664
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- **Segment** - Fixed incorrect margin set on `attached segment` #2503
- **Card** - `centered cards` variation now works similar to `centered card`. #2520
- **Checkbox** - Fixed issue in chrome where radio checkbox would appear incorrectly when no default value was selected #2505
- **Tab** - Tab now correctly obeys `cache` setting. Removed use of API's local caching by default. #2493

**Additional Bugs**
- **Dimmer** - Dimmer now removes variations like `blurring` and `inverted` when `destroy` is called.
Expand Down
16 changes: 8 additions & 8 deletions src/definitions/modules/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,12 @@ $.fn.tab = function(parameters) {
var
$tab = module.get.tabElement(tabPath),
apiSettings = {
dataType : 'html',
on : 'now',
cache : 'local',
dataType : 'html',
on : 'now',
cache : settings.alwaysRefresh,
headers : {
'X-Remote': true
},
onSuccess : function(response) {
module.cache.add(fullTabPath, response);
module.update.content(tabPath, response);
Expand Down Expand Up @@ -486,12 +489,9 @@ $.fn.tab = function(parameters) {
module.debug('Content is already loading', fullTabPath);
}
else if($.api !== undefined) {
requestSettings = $.extend(true, {
headers: {
'X-Remote': true
}
}, settings.apiSettings, apiSettings);
requestSettings = $.extend(true, {}, settings.apiSettings, apiSettings);
module.debug('Retrieving remote content', fullTabPath, requestSettings);
module.set.loading(tabPath);
$tab.api(requestSettings);
}
else {
Expand Down

0 comments on commit 7a53664

Please sign in to comment.