Commit f0ec3928 by Valera Rozuvan Committed by Alexander Kryklia

Made the style setting be applied by Python, not by JS. Made background of…

Made the style setting be applied by Python, not by JS. Made background of readonly elements light gray.
parent e703b3aa
...@@ -96,7 +96,7 @@ class GraphicalSliderToolModule(XModule): ...@@ -96,7 +96,7 @@ class GraphicalSliderToolModule(XModule):
#substitute sliders #substitute sliders
slider_div = '<div class="{element_class}_slider" \ slider_div = '<div class="{element_class}_slider" \
id="{element_id}_slider_{var}" \ id="{element_id}_slider_{var}" \
data-var="{var}" data-el_style="{style}">\ data-var="{var}" style="{style}">\
</div>' </div>'
for var in variables: for var in variables:
# find $slider var='var' ... $ # find $slider var='var' ... $
...@@ -127,7 +127,7 @@ class GraphicalSliderToolModule(XModule): ...@@ -127,7 +127,7 @@ class GraphicalSliderToolModule(XModule):
# substitute inputs if we have them # substitute inputs if we have them
input_el = '<input class="{element_class}_input" \ input_el = '<input class="{element_class}_input" \
id="{element_id}_input_{var}" \ id="{element_id}_input_{var}" \
data-var="{var}" data-el_style="{style}" \ data-var="{var}" style="{style}" \
data-el_readonly="{readonly}"/>' data-el_readonly="{readonly}"/>'
input_index = 0 # make multiple inputs for same variable have input_index = 0 # make multiple inputs for same variable have
......
...@@ -47,6 +47,7 @@ define('Inputs', ['logme'], function (logme) { ...@@ -47,6 +47,7 @@ define('Inputs', ['logme'], function (logme) {
// In the case of a readonly config option, configure the text // In the case of a readonly config option, configure the text
// inputit as read-only, and NOT bind an event to it. // inputit as read-only, and NOT bind an event to it.
inputDiv.attr('readonly', 'readonly'); inputDiv.attr('readonly', 'readonly');
inputDiv.css('background-color', '#D3D3D3');
} else { // readonly !== true } else { // readonly !== true
...@@ -63,14 +64,14 @@ define('Inputs', ['logme'], function (logme) { ...@@ -63,14 +64,14 @@ define('Inputs', ['logme'], function (logme) {
// Lets style the input element nicely. We will use the button() // Lets style the input element nicely. We will use the button()
// widget for this since there is no native widget for the text // widget for this since there is no native widget for the text
// input. // input.
inputDiv.button().css({ // inputDiv.button().css({
'font': 'inherit', // 'font': 'inherit',
'color': 'inherit', // 'color': 'inherit',
'text-align': 'left', // 'text-align': 'left',
'outline': 'none', // 'outline': 'none',
'cursor': 'text', // 'cursor': 'text',
'height': '15px' // 'height': '15px'
}); // });
// Tell the parameter object from state that we are attaching a // Tell the parameter object from state that we are attaching a
// text input to it. Next time the parameter will be updated with // text input to it. Next time the parameter will be updated with
......
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