Merge pull request #6986 from open-sausages/pulls/3.0/but-its-so-tinymce

Fix tinymce image selection issue in newer versions of Chrome
This commit is contained in:
Damian Mooyman 2017-06-06 17:24:31 +12:00 committed by GitHub
commit 058ba813e6
3 changed files with 12 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -16,10 +16,14 @@ require_once $frameworkPath . '/core/Constants.php';
// Handle incoming request if it's a script call
if (TinyMCE_Compressor::getParam("js")) {
// Default settings
$tempFolder = TEMP_FOLDER . '/tinymce-cache';
if (!file_exists($tempFolder)) {
mkdir($tempFolder);
}
// Default settings
$tinyMCECompressor = new TinyMCE_Compressor(array(
// CUSTOM SilverStripe
'cache_dir' => TEMP_FOLDER
'cache_dir' => $tempFolder
// CUSTOM END
));

View File

@ -1317,7 +1317,11 @@ tinymce.util.Quirks = function(editor) {
// WebKit can't even do simple things like selecting an image
// Needs tobe the setBaseAndExtend or it will fail to select floated images
if (/^(IMG|HR)$/.test(e.nodeName)) {
selection.getSel().setBaseAndExtent(e, 0, e, 1);
try {
selection.getSel().setBaseAndExtent(e, 0, e, 1);
} catch (error) {
selection.select(e);
}
}
if (e.nodeName == 'A' && dom.hasClass(e, 'mceItemAnchor')) {