mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Partially reverting 28e43bdc
which broke media insertion
This commit is contained in:
parent
23a3872e34
commit
0235a8c0c7
@ -159,8 +159,7 @@ class HtmlEditorField extends TextareaField {
|
||||
if($width && $height && ($width != $image->getWidth() || $height != $image->getHeight())) {
|
||||
//Make sure that the resized image actually returns an image:
|
||||
$resized=$image->ResizedImage($width, $height);
|
||||
if($resized)
|
||||
$img->setAttribute('src', $resized->getRelativePath());
|
||||
if($resized) $img->setAttribute('src', $resized->getRelativePath());
|
||||
}
|
||||
}
|
||||
|
||||
@ -432,7 +431,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
)
|
||||
);
|
||||
|
||||
$allFields -> addExtraClass('ss-insert-media');
|
||||
$allFields->addExtraClass('ss-insert-media');
|
||||
|
||||
$headings = new CompositeField(
|
||||
new LiteralField(
|
||||
|
@ -849,8 +849,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
* Insert updated HTML content into the rich text editor
|
||||
*/
|
||||
insertHTML: function() {
|
||||
|
||||
var ed = this.getEditor();
|
||||
var form = this.closest('form'), ed = form.getEditor();
|
||||
|
||||
// Workaround for browsers losing focus, similar to tinyMCEPopup.restoreSelection
|
||||
ed.moveToBookmark(window._ss_htmleditorfield_bookmark);
|
||||
@ -940,7 +939,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
* Logic similar to TinyMCE 'advimage' plugin, insertAndClose() method.
|
||||
*/
|
||||
insertHTML: function() {
|
||||
var form = this.closest('.cms').find('.cms-container textarea.htmleditor'), ed = form.getEditor(),
|
||||
var form = this.closest('form'), ed = form.getEditor(),
|
||||
node = $(ed.getSelectedNode()), captionNode = node.closest('.captionImage');
|
||||
|
||||
// Workaround for browsers losing focus, similar to tinyMCEPopup.restoreSelection.
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
<div class="ss-uploadfield-item $appCategory ss-htmleditorfield-file template-upload" data-id="$File.ID" data-url="$URL">
|
||||
<div class="ss-uploadfield-item-preview">
|
||||
<span>$Preview.SetRatioSize(30, 40)</span>
|
||||
@ -37,6 +35,3 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user