Fixed labels on inputs when autosomplete is used

This commit is contained in:
Godwin
2016-06-13 17:28:45 -07:00
parent 2b156269f9
commit a099059f2e
2 changed files with 31 additions and 18 deletions
+14 -8
View File
@@ -18,19 +18,25 @@
field.classList[input.value ? 'remove' : 'add']('empty');
}
positionLabel(input);
input.addEventListener('keyup', function(event) { positionLabel(event.target); });
input.addEventListener('blur', function(event) { field.classList.remove('focused'); });
input.addEventListener('focus', function(event) { field.classList.add('focused'); });
input.addEventListener('keyup', function(event) {
positionLabel(event.target);
});
input.addEventListener('blur', function(event) {
positionLabel(event.target);
field.classList.remove('focused');
});
input.addEventListener('focus', function(event) {
field.classList.add('focused');
});
});
var body = document.querySelector('body');
var primaryContent = document.getElementById('primary-content');
var overlay = document.getElementById('content-overlay');
primaryContent.addEventListener('keydown', function(event) {
event.stopPropagation();
return false;
//if (body.classList.contains('has-overlay')) {
// return false;
//}
if (body.classList.contains('has-overlay')) {
event.stopPropagation();
return false;
}
});
document.addEventListener('focus', function(event) {
if (overlay.querySelector('.dlg.open') && !overlay.querySelector('.dlg.open :focus')) {