Browse Source

#2754, fix issue with not using correct metadata setting for label value

pull/2755/merge
Jack Lukic 9 years ago
parent
commit
506f96ffd7
3 changed files with 5 additions and 4 deletions
  1. 1
      RELEASE-NOTES.md
  2. 6
      src/definitions/modules/dropdown.js
  3. 2
      src/definitions/modules/tab.js

1
RELEASE-NOTES.md

@ -51,6 +51,7 @@
- **Menu** - Fix text align on `dropdown item` inside `icon menu` - **Menu** - Fix text align on `dropdown item` inside `icon menu`
- **Menu** - Fixed issue with `labeled input` text inside menu not appearing vertically centered - **Menu** - Fixed issue with `labeled input` text inside menu not appearing vertically centered
- **Menu** - Fixed hybrid initialization not creating `menu` correctly. Fixed docs example of hybrid `<select>` initialization - **Menu** - Fixed hybrid initialization not creating `menu` correctly. Fixed docs example of hybrid `<select>` initialization
- **Dropdown/Tab** - Fixed an instance where `metadata` was not referencing settings metadata value
**[Merged PR](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed)** **[Merged PR](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed)**

6
src/definitions/modules/dropdown.js

@ -634,7 +634,6 @@ $.fn.dropdown = function(parameters) {
apiSettings = { apiSettings = {
errorDuration : false, errorDuration : false,
throttle : settings.throttle, throttle : settings.throttle,
cache : 'local',
urlData : { urlData : {
query: query query: query
}, },
@ -999,7 +998,7 @@ $.fn.dropdown = function(parameters) {
var var
$label = $module.find(selector.label), $label = $module.find(selector.label),
$activeLabel = $label.filter('.' + className.active), $activeLabel = $label.filter('.' + className.active),
activeValue = $activeLabel.data('value'),
activeValue = $activeLabel.data(metadata.value),
labelIndex = $label.index($activeLabel), labelIndex = $label.index($activeLabel),
labelCount = $label.length, labelCount = $label.length,
hasActiveLabel = ($activeLabel.length > 0), hasActiveLabel = ($activeLabel.length > 0),
@ -1363,6 +1362,7 @@ $.fn.dropdown = function(parameters) {
}, },
hide: function() { hide: function() {
module.set.value(value);
module.hideAndClear(); module.hideAndClear();
} }
@ -2596,7 +2596,7 @@ $.fn.dropdown = function(parameters) {
$labels $labels
.each(function(){ .each(function(){
var var
value = $(this).data('value'),
value = $(this).data(metadata.value),
isUserValue = module.is.userValue(value) isUserValue = module.is.userValue(value)
; ;
if(isUserValue) { if(isUserValue) {

2
src/definitions/modules/tab.js

@ -374,7 +374,7 @@ $.fn.tab = function(parameters) {
else if(tabPath.search('/') == -1 && tabPath !== '') { else if(tabPath.search('/') == -1 && tabPath !== '') {
// look for in page anchor // look for in page anchor
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]'); $anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]');
currentPath = $anchor.closest('[data-tab]').data('tab');
currentPath = $anchor.closest('[data-tab]').data(metadata.tab);
$tab = module.get.tabElement(currentPath); $tab = module.get.tabElement(currentPath);
// if anchor exists use parent tab // if anchor exists use parent tab
if($anchor && $anchor.length > 0 && currentPath) { if($anchor && $anchor.length > 0 && currentPath) {

Loading…
Cancel
Save