Skip to content

Commit

Permalink
fixed #438
Browse files Browse the repository at this point in the history
  • Loading branch information
amsul committed Jul 6, 2014
1 parent 4041628 commit dee2e4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [#476](https://github.com/amsul/pickadate.js/issues/476): Fixed the `main` files in `bower.json`.
- [#451](https://github.com/amsul/pickadate.js/issues/451): Added French accessibility labels.
- [#442](https://github.com/amsul/pickadate.js/issues/442): Fixed flickering on webkit browsers.
- [#438](https://github.com/amsul/pickadate.js/issues/438): Fixed adding an ID to the hidden element to remain unique.


## 3.5.2
Expand Down
1 change: 1 addition & 0 deletions _docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [#476]({%= pkg.bugs %}/476): Fixed the `main` files in `bower.json`.
- [#451]({%= pkg.bugs %}/451): Added French accessibility labels.
- [#442]({%= pkg.bugs %}/442): Fixed flickering on webkit browsers.
- [#438]({%= pkg.bugs %}/438): Fixed adding an ID to the hidden element to remain unique.


## 3.5.2
Expand Down
2 changes: 1 addition & 1 deletion lib/compressed/picker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions lib/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,11 +710,9 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
*/
function prepareElementHidden() {

var id,
name
var name

if ( SETTINGS.hiddenName === true ) {
id = ELEMENT.name + '_hidden'
name = ELEMENT.name
ELEMENT.name = ''
}
Expand All @@ -723,17 +721,18 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',
typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'
]
name = id = name[0] + ELEMENT.name + name[1]
name = name[0] + ELEMENT.name + name[1]
}

P._hidden = $(
'<input ' +
'type=hidden ' +

// Create the name and ID by using the original
// input’s with a prefix and suffix.
// Create the name using the original input’s with a prefix and suffix.
'name="' + name + '"' +
'id="' + id + '"' +

// Create the ID using the original input’s; only if it has one.
(ELEMENT.id ? 'id="' + ELEMENT.id + '_hidden"' : '') +

// If the element has a value, set the hidden value as well.
(
Expand Down

0 comments on commit dee2e4d

Please sign in to comment.