Browse Source

Fixes issue where cache local was not working because debug code

pull/3704/head
Jack Lukic 8 years ago
parent
commit
c34f6d3462
3 changed files with 19 additions and 10 deletions
  1. 11
      RELEASE-NOTES.md
  2. 5
      src/definitions/behaviors/api.js
  3. 13
      src/definitions/modules/dropdown.js

11
RELEASE-NOTES.md

@ -6,20 +6,25 @@
- **Dropdown** - All dropdowns, not just `selection dropdown`, will now select the first `menu item` that starts with a pressed keyboard key, for example "N" will select "New" - **Dropdown** - All dropdowns, not just `selection dropdown`, will now select the first `menu item` that starts with a pressed keyboard key, for example "N" will select "New"
- **Build Tools** - Added new `autoInstall` option to allow for Semantic to be installed without user interaction. See [docs explanation](http://www.semantic-ui.com/introduction/advanced-usage.html#Auto-Install) for how to use. #3616 **Thanks @algorithme** - **Build Tools** - Added new `autoInstall` option to allow for Semantic to be installed without user interaction. See [docs explanation](http://www.semantic-ui.com/introduction/advanced-usage.html#Auto-Install) for how to use. #3616 **Thanks @algorithme**
**Critical Bugs**
- **API** - Fixed bug causing `cache: 'local'` not to return the localstorage cached results in some cases
- **API** - Fixes bug where `beforeSend` would not correctly cancel request when `return false;` is used in callback. #3660
-**Form Validation / Dropdown** - Fixed issue where using "enter" key in a `search dropdown` could cause a form to be submitted #3676
-**Divider** - Fixed issue where descenders like "g" would be cut off in `horizontal divider` #3585
**Bugs** **Bugs**
- **Dropdown** - Fixed issue where `apiSettings` was not defaulting to use `cache: 'local'` as specified in the docs
- **Dropdown** - Fixed issue where dropdowns with sub-menus would not properly activate on mobile #3183 - **Dropdown** - Fixed issue where dropdowns with sub-menus would not properly activate on mobile #3183
- **API** - Fixes bug where `beforeSend` would not correctly cancel request when `return false;` is used in callback. #3660
- **Modal** - Fixes issue where RGB values set for dimmer `background-color` werent being correctly interpreted #3665 **Thanks @larsbo** - **Modal** - Fixes issue where RGB values set for dimmer `background-color` werent being correctly interpreted #3665 **Thanks @larsbo**
- **Form** - Fixed use of deprecated `size()` method in `prompt` #3655 **Thanks @SimonArdrey** - **Form** - Fixed use of deprecated `size()` method in `prompt` #3655 **Thanks @SimonArdrey**
-**Table** - Fixed issue where `striped selectable` table would not correctly show hover color on striped rows -**Table** - Fixed issue where `striped selectable` table would not correctly show hover color on striped rows
-**Segment/Message** - Fixed issue where `top attached message` would have no border when attached to `segment` #3619 -**Segment/Message** - Fixed issue where `top attached message` would have no border when attached to `segment` #3619
-**Divider** - Fixed issue where descenders like "g" would be cut off in `horizontal divider` #3585
-**Popup** - Fixed issue where checking `instanceof SVGGraphicsElement` caused error in IE11 #3043 -**Popup** - Fixed issue where checking `instanceof SVGGraphicsElement` caused error in IE11 #3043
-**Form Validation / Dropdown** - Fixed issue where using "enter" key in a `search dropdown` could cause a form to be submitted #3676
-**Button** - Fixes issue where `right icon` like `right arrow icon` would have additional margin inside an `icon button` #3525 -**Button** - Fixes issue where `right icon` like `right arrow icon` would have additional margin inside an `icon button` #3525
**Grid** - Fixed issue where `centered` content would cause `justified` content to appear aligned left. #3496 **Grid** - Fixed issue where `centered` content would cause `justified` content to appear aligned left. #3496
**Enhancements** **Enhancements**
-**Dropdown** - Using API with dropdown will now
-**Site** `@px` and `@relativepx` i.e. `@relative12px` which can be used to return EM value of pixels are now extended to `@relative40px` -**Site** `@px` and `@relativepx` i.e. `@relative12px` which can be used to return EM value of pixels are now extended to `@relative40px`
-**Tabs** - Added option `deactivate`, defaults to `siblings` which will only deactivate tab activators that are DOM siblings elements to the activating element. Setting it to <code>'all'</code> will deactivate any other tab element initialized at the same time. -**Tabs** - Added option `deactivate`, defaults to `siblings` which will only deactivate tab activators that are DOM siblings elements to the activating element. Setting it to <code>'all'</code> will deactivate any other tab element initialized at the same time.
-**Table** - Added more granular variablaes for controlling style on first column in a `definition table` -**Table** - Added more granular variablaes for controlling style on first column in a `definition table`

5
src/definitions/behaviors/api.js

@ -141,7 +141,7 @@ $.api = $.fn.api = function(parameters) {
response = sessionStorage.getItem(url); response = sessionStorage.getItem(url);
module.debug('Using cached response', url, response); module.debug('Using cached response', url, response);
response = module.decode.json(response); response = module.decode.json(response);
return false;
return response;
} }
}, },
write: { write: {
@ -233,7 +233,6 @@ $.api = $.fn.api = function(parameters) {
module.debug('Querying URL', ajaxSettings.url); module.debug('Querying URL', ajaxSettings.url);
module.verbose('Using AJAX settings', ajaxSettings); module.verbose('Using AJAX settings', ajaxSettings);
if(settings.cache === 'local' && module.read.cachedResponse(url)) { if(settings.cache === 'local' && module.read.cachedResponse(url)) {
module.debug('Response returned from local cache'); module.debug('Response returned from local cache');
module.request = module.create.request(); module.request = module.create.request();
@ -752,7 +751,7 @@ $.api = $.fn.api = function(parameters) {
if( module.is.input() ) { if( module.is.input() ) {
data.value = $module.val(); data.value = $module.val();
} }
else if( !module.is.form() ) {
else if( module.is.form() ) {
} }
else { else {

13
src/definitions/modules/dropdown.js

@ -260,7 +260,11 @@ $.fn.dropdown = function(parameters) {
api: function() { api: function() {
var var
apiSettings = { apiSettings = {
debug : settings.debug,
debug : settings.debug,
urlData : {
value : module.get.value(),
query : module.get.query()
},
on : false on : false
} }
; ;
@ -652,9 +656,10 @@ $.fn.dropdown = function(parameters) {
queryRemote: function(query, callback) { queryRemote: function(query, callback) {
var var
apiSettings = { apiSettings = {
errorDuration : false,
throttle : settings.throttle,
urlData : {
errorDuration : false,
cache : 'local',
throttle : settings.throttle,
urlData : {
query: query query: query
}, },
onError: function() { onError: function() {

Loading…
Cancel
Save