Skip to content
This repository
Browse code

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...
commit f546ab2a706fb34cb3463a2fe89821f204a04061 2 parents 82db288 + fdebedd
Ingo Schommer authored May 09, 2012
5  forms/HtmlEditorField.php
@@ -313,8 +313,9 @@ function LinkForm() {
313 313
 							'external' => _t('HtmlEditorField.LINKEXTERNAL', 'Another website'),
314 314
 							'anchor' => _t('HtmlEditorField.LINKANCHOR', 'Anchor on this page'),
315 315
 							'email' => _t('HtmlEditorField.LINKEMAIL', 'Email address'),
316  
-							'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'),			
317  
-						)
  316
+							'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'),
  317
+						),
  318
+						'internal'
318 319
 					),
319 320
 					new LiteralField('Step2',
320 321
 						'<div class="step2">' . sprintf($numericLabelTmpl, '2', _t('HtmlEditorField.DETAILS', 'Details')) . '</div>'
3  javascript/HtmlEditorField.js
@@ -295,6 +295,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
295 295
 						url: url,
296 296
 						success: function(html) {
297 297
 							dialog.html(html);
  298
+							dialog.getForm().redraw();
298 299
 						}
299 300
 					});
300 301
 				}
@@ -330,7 +331,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
330 331
 			},
331 332
 			ondialogopen: function(e) {
332 333
 				this.getForm().updateFromEditor();
333  
-				this.redraw();
  334
+				this.getForm().redraw();
334 335
 			},
335 336
 			ondialogclose: function(e) {
336 337
 				this.getForm().resetFields();

0 notes on commit f546ab2

Please sign in to comment.
Something went wrong with that request. Please try again.