From 7a5366423c9be107e18cd05923db6f4f916434bb Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 6 Jul 2015 14:03:46 -0400 Subject: [PATCH] Fix issues with ajax tabs not obeying cache #2493 --- RELEASE-NOTES.md | 1 + src/definitions/modules/tab.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index b49fcdd88..1f385a82e 100644 --- a/RELEASE-NOTES.md +++ b/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. diff --git a/src/definitions/modules/tab.js b/src/definitions/modules/tab.js index 57cbb24d7..e1860d8b3 100644 --- a/src/definitions/modules/tab.js +++ b/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 {