-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2051 from sparkdesignsystem/staging
Publish Oct 4th, 2019
- Loading branch information
Showing
133 changed files
with
7,849 additions
and
5,497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import getElements from '../utilities/getElements'; | ||
import toggleClassWithValue from '../utilities/toggleClassWithValue'; | ||
import addClassIfNotEmpty from '../utilities/addClassIfNotEmpty'; | ||
|
||
/* | ||
* TODO: Deprecate the code below | ||
* that adds the class of `sprk-b-TextInput--float-label` | ||
* in favor of the more universal `sprk-b-Input--has-floating-label`. | ||
*/ | ||
const bindUIEvents = element => { | ||
toggleClassWithValue(element, 'sprk-b-TextInput--float-label', 'input'); | ||
}; | ||
|
||
const bindUIEventsHugeInput = element => { | ||
if (element.tagName === 'SELECT') { | ||
toggleClassWithValue(element, 'sprk-b-Input--has-floating-label', 'change'); | ||
} else { | ||
toggleClassWithValue(element, 'sprk-b-Input--has-floating-label', 'input'); | ||
} | ||
}; | ||
|
||
const hugeInput = () => { | ||
const oldSelector = '[data-sprk-input="hugeTextInput"]'; | ||
const oldClassName = 'sprk-b-TextInput--float-label'; | ||
const newSelector = '[data-sprk-input="huge"]'; | ||
const newClassName = 'sprk-b-Input--has-floating-label'; | ||
|
||
window.addEventListener('load', () => { | ||
getElements(oldSelector, element => { | ||
addClassIfNotEmpty(element, oldClassName); | ||
}); | ||
getElements(newSelector, element => { | ||
addClassIfNotEmpty(element, newClassName); | ||
}); | ||
}); | ||
/* | ||
* TODO: Deprecate the code below | ||
* that gets elements with the oldSelector | ||
* in favor of the more universal newSelector. | ||
*/ | ||
getElements(oldSelector, bindUIEvents); | ||
|
||
getElements(newSelector, bindUIEventsHugeInput); | ||
}; | ||
|
||
export { hugeInput, bindUIEventsHugeInput, bindUIEvents }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.