BUGFIX Partially reverting 28e43bdc which broke media insertion

This commit is contained in:
Sean Harvey 2012-05-28 22:27:20 +12:00
parent 23a3872e34
commit 0235a8c0c7
3 changed files with 10 additions and 17 deletions

View File

@ -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(

View File

@ -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.

View File

@ -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>