Permalink
Browse files

Merge pull request #417 from halkyon/sapphire

---

Ensure the lazy loaded form inside htmleditorfield-dialog is redrawn when lazy loaded. This fixes the initial state for the insert link dialog form.

Also ensure the link form uses "internal" as the default, so the initial state doesnt show all fields, just those associated with the first radio option "internal".

This also fixes http://open.silverstripe.org/ticket/7273.
  • Loading branch information...
2 parents 82db288 + fdebedd commit f546ab2a706fb34cb3463a2fe89821f204a04061 @chillu chillu committed May 9, 2012
Showing with 5 additions and 3 deletions.
  1. +3 −2 forms/HtmlEditorField.php
  2. +2 −1 javascript/HtmlEditorField.js
@@ -313,8 +313,9 @@ function LinkForm() {
'external' => _t('HtmlEditorField.LINKEXTERNAL', 'Another website'),
'anchor' => _t('HtmlEditorField.LINKANCHOR', 'Anchor on this page'),
'email' => _t('HtmlEditorField.LINKEMAIL', 'Email address'),
- 'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'),
- )
+ 'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'),
+ ),
+ 'internal'
),
new LiteralField('Step2',
'<div class="step2">' . sprintf($numericLabelTmpl, '2', _t('HtmlEditorField.DETAILS', 'Details')) . '</div>'
@@ -295,6 +295,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
url: url,
success: function(html) {
dialog.html(html);
+ dialog.getForm().redraw();
}
});
}
@@ -330,7 +331,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
},
ondialogopen: function(e) {
this.getForm().updateFromEditor();
- this.redraw();
+ this.getForm().redraw();
},
ondialogclose: function(e) {
this.getForm().resetFields();

0 comments on commit f546ab2

Please sign in to comment.