mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 17:54:44 +02:00
Fix issue processwire/processwire-issues#1703 PageFrontEdit and InputfieldTinyMCE
This commit is contained in:
@@ -87,7 +87,7 @@ function PageFrontEditInit($) {
|
|||||||
InputfieldTinyMCE.init('#' + copyID, 'PageFrontEdit');
|
InputfieldTinyMCE.init('#' + copyID, 'PageFrontEdit');
|
||||||
var editor = tinymce.get(copyID);
|
var editor = tinymce.get(copyID);
|
||||||
tinymces[copyID] = editor;
|
tinymces[copyID] = editor;
|
||||||
editor.on('dirty', function(e) {
|
editor.on('dirty change', function(e) {
|
||||||
t.addClass('pw-changed');
|
t.addClass('pw-changed');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -110,6 +110,7 @@ function PageFrontEditInit($) {
|
|||||||
var name = t.attr('data-name');
|
var name = t.attr('data-name');
|
||||||
|
|
||||||
copy.hide();
|
copy.hide();
|
||||||
|
orig.show();
|
||||||
|
|
||||||
if(isTouch) orig.on('pwdoubletap', function(e) {
|
if(isTouch) orig.on('pwdoubletap', function(e) {
|
||||||
inlineEditEvent(e, t, orig, copy);
|
inlineEditEvent(e, t, orig, copy);
|
||||||
@@ -279,6 +280,8 @@ function PageFrontEditInit($) {
|
|||||||
for(var copyID in tinymces) {
|
for(var copyID in tinymces) {
|
||||||
InputfieldTinyMCE.destroyEditors($('#' + copyID));
|
InputfieldTinyMCE.destroyEditors($('#' + copyID));
|
||||||
}
|
}
|
||||||
|
$('.InputfieldTinyMCELoaded').removeClass('InputfieldTinyMCELoaded');
|
||||||
|
$('.pw-edit-InputfieldTinyMCE').removeClass('pw-editing pw-edited');
|
||||||
tinymces = {}
|
tinymces = {}
|
||||||
|
|
||||||
// post save data to server
|
// post save data to server
|
||||||
@@ -323,7 +326,7 @@ function PageFrontEditInit($) {
|
|||||||
buttons.hide();
|
buttons.hide();
|
||||||
$('.pw-editing, .pw-edited').each(function() {
|
$('.pw-editing, .pw-edited').each(function() {
|
||||||
var t = $(this);
|
var t = $(this);
|
||||||
t.removeClass('pw-editing, pw-edited, pw-changed');
|
t.removeClass('pw-editing pw-edited pw-changed');
|
||||||
var orig = t.children('.pw-edit-orig');
|
var orig = t.children('.pw-edit-orig');
|
||||||
var copy = t.children('.pw-edit-copy');
|
var copy = t.children('.pw-edit-copy');
|
||||||
copy.hide();
|
copy.hide();
|
||||||
@@ -336,6 +339,9 @@ function PageFrontEditInit($) {
|
|||||||
instance.destroy();
|
instance.destroy();
|
||||||
}
|
}
|
||||||
ckeditors = {};
|
ckeditors = {};
|
||||||
|
$('.pw-edit-InputfieldTinyMCE').each(function() {
|
||||||
|
inlineInitEditableRegion($(this));
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -22,7 +22,7 @@ class PageFrontEdit extends WireData implements Module {
|
|||||||
return array(
|
return array(
|
||||||
'title' => 'Front-End Page Editor',
|
'title' => 'Front-End Page Editor',
|
||||||
'summary' => 'Enables front-end editing of page fields.',
|
'summary' => 'Enables front-end editing of page fields.',
|
||||||
'version' => 5,
|
'version' => 6,
|
||||||
'author' => 'Ryan Cramer',
|
'author' => 'Ryan Cramer',
|
||||||
'license' => 'MPL 2.0',
|
'license' => 'MPL 2.0',
|
||||||
'icon' => 'cube',
|
'icon' => 'cube',
|
||||||
|
Reference in New Issue
Block a user