From 2969a9e48dce189769052b29dd583c4738fdf1fb Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 23 Jan 2013 16:19:17 -0500 Subject: [PATCH] Toggling of code should mark editor as dirty. --- common/lib/xmodule/xmodule/js/src/html/edit.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/lib/xmodule/xmodule/js/src/html/edit.coffee b/common/lib/xmodule/xmodule/js/src/html/edit.coffee index 35c4464c89..39f1d8edef 100644 --- a/common/lib/xmodule/xmodule/js/src/html/edit.coffee +++ b/common/lib/xmodule/xmodule/js/src/html/edit.coffee @@ -54,6 +54,9 @@ class @HTMLEditingDescriptor image : '/static/images/ico-tinymce-code.png', onclick : () -> ed.formatter.toggle('code') + # Without this, the dirty flag does not get set unless the user also types in text. + # Visual Editor must be marked as dirty or else we won't populate the Advanced Editor from it. + ed.isNotDirty = false }) ed.onNodeChange.add((editor, command, e) ->