Merge pull request #6370 from edx/waheed/tnl920-fix-code-mirror-xml-editor-height

Fixed CodeMirror editor view height in studio.
This commit is contained in:
Waheed Ahmed
2015-01-13 13:31:55 +05:00
3 changed files with 12 additions and 4 deletions

View File

@@ -222,6 +222,10 @@
height: 365px;
}
.CodeMirror-advanced {
height: 435px;
}
.wrapper-comp-settings {
.list-input {

View File

@@ -80,6 +80,9 @@ Write a persuasive essay to a newspaper reflecting your views on censorship in l
if text
@xml_editor.setValue(text)
@setCurrentEditor(@xml_editor)
$(@xml_editor.getWrapperElement()).toggleClass("CodeMirror-advanced");
# Need to refresh to get line numbers to display properly.
@xml_editor.refresh()
###
User has clicked to show the XML editor. Before XML editor is swapped in,
@@ -92,9 +95,8 @@ Write a persuasive essay to a newspaper reflecting your views on censorship in l
@toggleCheatsheetVisibility()
if @confirmConversionToXml()
@createXMLEditor(OpenEndedMarkdownEditingDescriptor.markdownToXml(@markdown_editor.getValue()))
# Need to refresh to get line numbers to display properly (and put cursor position to 0)
# Put cursor position to 0.
@xml_editor.setCursor(0)
@xml_editor.refresh()
# Hide markdown-specific toolbar buttons
$(@element.find('.editor-bar')).hide()

View File

@@ -41,6 +41,9 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
if text
@xml_editor.setValue(text)
@setCurrentEditor(@xml_editor)
$(@xml_editor.getWrapperElement()).toggleClass("CodeMirror-advanced");
# Need to refresh to get line numbers to display properly.
@xml_editor.refresh()
###
User has clicked to show the XML editor. Before XML editor is swapped in,
@@ -53,9 +56,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
@toggleCheatsheetVisibility()
if @confirmConversionToXml()
@createXMLEditor(MarkdownEditingDescriptor.markdownToXml(@markdown_editor.getValue()))
# Need to refresh to get line numbers to display properly (and put cursor position to 0)
# Put cursor position to 0.
@xml_editor.setCursor(0)
@xml_editor.refresh()
# Hide markdown-specific toolbar buttons
$(@element.find('.editor-bar')).hide()