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
/** | |
* Synchronization store with localStorage | |
* Allows to take the default states from localStorage | |
* @param {strign} name reducer's name preferable | |
* @param {object} defaultInitial reducer's default state | |
* @return {object} initial state and methods | |
*/ | |
export default (name, defaultInitial) => { | |
const localStorageState = localStorage.getItem(`yakutia.${name}`); | |
const mergedState = localStorageState && JSON.parse(localStorageState); |
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
var MaskedInput = function (el) { | |
var mask = el.getAttribute('data-mask'); | |
var symbolArray = mask.split(''); | |
var maskArray = mask.split(''); | |
var carretPosition = symbolArray.indexOf('_'); | |
el.setAttribute('placeholder', mask); | |
/** | |
* Is char a digit? |
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
1 |
NewerOlder