Browse Source

Fix issues with ajax tabs not obeying cache #2493

pull/2536/head
jlukic 9 years ago
parent
commit
7a5366423c
2 changed files with 9 additions and 8 deletions
  1. 1
      RELEASE-NOTES.md
  2. 16
      src/definitions/modules/tab.js

1
RELEASE-NOTES.md

@ -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.

16
src/definitions/modules/tab.js

@ -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);
@ -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 {

Loading…
Cancel
Save