Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
225
Merge Requests
225
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
924be51a
Commit
924be51a
authored
Apr 18, 2013
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1954968
by Wim Leers | YesCT: Fixed Required CKEditor fields always fail HTML5 validation.
parent
24f54620
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
core/modules/editor/js/editor.js
core/modules/editor/js/editor.js
+16
-0
No files found.
core/modules/editor/js/editor.js
View file @
924be51a
...
...
@@ -96,12 +96,28 @@ Drupal.behaviors.editor = {
Drupal
.
editorAttach
=
function
(
field
,
format
)
{
if
(
format
.
editor
)
{
// HTML5 validation cannot ever work for WYSIWYG editors, because WYSIWYG
// editors always hide the underlying textarea element, which prevents
// browsers from putting the error message bubble in the right location.
// Hence: disable HTML5 validation for this element.
if
(
'
required
'
in
field
.
attributes
)
{
field
.
setAttribute
(
'
data-editor-required
'
,
true
);
field
.
removeAttribute
(
'
required
'
);
}
Drupal
.
editors
[
format
.
editor
].
attach
(
field
,
format
);
}
};
Drupal
.
editorDetach
=
function
(
field
,
format
,
trigger
)
{
if
(
format
.
editor
)
{
// Restore the HTML5 validation "required" attribute if it was removed in
// Drupal.editorAttach().
if
(
'
data-editor-required
'
in
field
.
attributes
)
{
field
.
setAttribute
(
'
required
'
,
'
required
'
);
field
.
removeAttribute
(
'
data-editor-required
'
);
}
Drupal
.
editors
[
format
.
editor
].
detach
(
field
,
format
,
trigger
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment