Permalink
Browse files

fix(inputfield): deleted js, animation is done by css

  • Loading branch information...
Freihofner, Katrin Freihofner, Katrin
Freihofner, Katrin authored and Freihofner, Katrin committed Nov 11, 2016
1 parent fe1003b commit 891ae1b9184c5f1e0e9c359cf1a73eb309815c6e
Showing with 0 additions and 45 deletions.
  1. +0 −44 src/inputfield/inputfield.js
  2. +0 −1 src/main.js
@@ -1,44 +0,0 @@
import $ from '../js-common-components/dollar';
function dateFieldChangeHandler() {
if (isNaN(this.value)) {
this.classList.remove('inputfield--date--placeholder');
this.classList.add('inputfield--date');
} else {
this.classList.remove('inputfield--date');
this.classList.add('inputfield--date--placeholder');
}
}
const validateDate = () => {
$('input[type=date]').forEach(el => {
if (!el.getAttribute('data-initialized')) {
el.addEventListener('keyup', dateFieldChangeHandler);
el.setAttribute('data-initialized', true);
}
});
};
function searchFieldChangeHandler() {
if (this.value !== '') {
this.style.backgroundImage = 'none';
} else {
this.style.backgroundImage =
'url(/assets/images/icons/Icons_file_002_Search_Magnifying_glass.svg)';
}
}
const initSearch = () => {
$('input[type=search]').forEach(el => {
if (!el.getAttribute('search-initialized')) {
el.addEventListener('keyup', searchFieldChangeHandler);
el.setAttribute('search-initialized', true);
}
});
};
validateDate();
initSearch();
View
@@ -2,6 +2,5 @@
require('./js-common-components/toggler');
require('./js-common-components/closest');
require('./expandable/expandable');
require('./inputfield/inputfield');
require('./tabs/tabs');
require('./slider/slider');

0 comments on commit 891ae1b

Please sign in to comment.