Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
qfq
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typo3
qfq
Commits
b3b2d9b3
Commit
b3b2d9b3
authored
Dec 02, 2019
by
Benjamin Baer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'B7974-TinyMCEReadOnly' into 'master'
B7974 tiny mce read only See merge request
!215
parents
d3d89e03
55f1aa37
Pipeline
#2835
passed with stages
in 2 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
javascript/src/Helper/tinyMCE.js
javascript/src/Helper/tinyMCE.js
+19
-0
No files found.
javascript/src/Helper/tinyMCE.js
View file @
b3b2d9b3
...
...
@@ -28,6 +28,7 @@ QfqNS.Helper = QfqNS.Helper || {};
* @function
*/
var
tinyMce
=
function
()
{
if
(
typeof
tinymce
===
'
undefined
'
)
{
//QfqNS.log.error("tinymce not loaded, cannot initialize Qfq tinymce.");
return
;
...
...
@@ -36,6 +37,7 @@ QfqNS.Helper = QfqNS.Helper || {};
$
(
"
.qfq-tinymce
"
).
each
(
function
()
{
var
config
=
{};
var
myEditor
=
{};
var
$this
=
$
(
this
);
var
tinyMCEId
=
$this
.
attr
(
'
id
'
);
if
(
!
tinyMCEId
)
{
...
...
@@ -55,6 +57,7 @@ QfqNS.Helper = QfqNS.Helper || {};
config
.
selector
=
"
#
"
+
QfqNS
.
escapeJqueryIdSelector
(
tinyMCEId
);
config
.
setup
=
function
(
editor
)
{
myEditor
=
editor
;
editor
.
on
(
'
Change
'
,
function
(
e
)
{
// Ensure the associated form is notified of changes in editor.
QfqNS
.
Log
.
debug
(
'
Editor was changed
'
);
...
...
@@ -63,9 +66,25 @@ QfqNS.Helper = QfqNS.Helper || {};
$parentForm
.
trigger
(
"
change
"
);
});
/* Remove ReadOnly Again - we have to implement tinymce differently
to make it easier to change such attributes */
var
me
=
editor
;
var
$parent
=
$
(
config
.
selector
);
$parent
.
parent
(
'
div
'
).
mouseenter
(
function
(
e
)
{
if
(
$parent
.
is
(
'
[readonly="readonly"]
'
))
{
me
.
setMode
(
"
readonly
"
);
}
else
{
me
.
setMode
(
"
design
"
);
}
});
};
tinymce
.
init
(
config
);
if
(
$
(
this
).
is
(
'
[readonly]
'
))
{
myEditor
.
setMode
(
"
readonly
"
);
}
}
);
};
...
...
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