Skip to content

Commit

Permalink
IBX-643: Redesigned ezemail
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 committed Aug 13, 2021
1 parent a098349 commit 1618982
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/bundle/Resources/public/js/scripts/fieldType/ezemail.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(global, doc, eZ) {
const SELECTOR_FIELD = '.ez-field-edit--ezemail';
const SELECTOR_ERROR_NODE = '.ez-data-source';
const SELECTOR_FIELD = '.ibexa-field-edit--ezemail';
const SELECTOR_ERROR_NODE = '.ibexa-form-error';

class EzEmailValidator extends eZ.BaseFieldValidator {
/**
Expand All @@ -17,7 +17,7 @@
const isEmpty = !input.value.trim();
const isValid = eZ.errors.emailRegexp.test(input.value);
const isError = (isRequired && isEmpty) || (!isEmpty && !isValid);
const label = input.closest(SELECTOR_FIELD).querySelector('.ez-field-edit__label').innerHTML;
const label = input.closest(SELECTOR_FIELD).querySelector('.ibexa-field-edit__label').innerHTML;
const result = { isError };

if (isRequired && isEmpty) {
Expand All @@ -35,7 +35,7 @@
fieldSelector: SELECTOR_FIELD,
eventsMap: [
{
selector: '.ez-field-edit--ezemail input',
selector: '.ibexa-field-edit--ezemail input',
eventName: 'blur',
callback: 'validateInput',
errorNodeSelectors: [SELECTOR_ERROR_NODE],
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/public/scss/fieldType/edit/_ezemail.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.ez-field-edit--ezemail {
.ez-field-edit__data {
.ibexa-field-edit--ezemail {
.ibexa-field-edit__data {
width: 50%;
max-width: calculateRem(500px);
}
Expand Down

0 comments on commit 1618982

Please sign in to comment.