Commit 94ce535f by Sarina Canelake

Merge pull request #1008 from edx/fix/ichuang/inline-for-formulaequationinput

add inline style flag to formulaequationinput
parents 54ea98d2 5b460ff6
...@@ -1081,7 +1081,10 @@ class FormulaEquationInput(InputTypeBase): ...@@ -1081,7 +1081,10 @@ class FormulaEquationInput(InputTypeBase):
""" """
Can set size of text field. Can set size of text field.
""" """
return [Attribute('size', '20'), ] return [
Attribute('size', '20'),
Attribute('inline', False),
]
def _extra_context(self): def _extra_context(self):
""" """
......
<section id="formulaequationinput_${id}" class="inputtype formulaequationinput"> <% doinline = 'style="display:inline-block;vertical-align:top"' if inline else "" %>
<section id="formulaequationinput_${id}" class="inputtype formulaequationinput" ${doinline}>
<div class="${reported_status}" id="status_${id}"> <div class="${reported_status}" id="status_${id}">
<input type="text" name="input_${id}" id="input_${id}" <input type="text" name="input_${id}" id="input_${id}"
data-input-id="${id}" value="${value|h}" data-input-id="${id}" value="${value|h}"
......
...@@ -808,6 +808,7 @@ class FormulaEquationTest(unittest.TestCase): ...@@ -808,6 +808,7 @@ class FormulaEquationTest(unittest.TestCase):
'msg': '', 'msg': '',
'size': self.size, 'size': self.size,
'previewer': '/static/js/capa/src/formula_equation_preview.js', 'previewer': '/static/js/capa/src/formula_equation_preview.js',
'inline': False,
} }
self.assertEqual(context, expected) self.assertEqual(context, expected)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment