- var preview = $(this).parents(".richtext_container").find(".richtext_preview");
-
- preview.hide();
- editor.show();
-
- $(this).siblings(".richtext_dopreview").prop("disabled", false);
- $(this).prop("disabled", true);
-
- event.preventDefault();
- });
-
- /*
- * Install a click handler to switch to preview mode when the
- * preview button is pressed.
- */
- $(".richtext_dopreview").click(function (event) {
- var editor = $(this).parents(".richtext_container").find("textarea");
- var preview = $(this).parents(".richtext_container").find(".richtext_preview");
- var width = editor.outerWidth() - preview.outerWidth() + preview.width();