Commit 1770de73 by Valera Rozuvan Committed by Alexander Kryklia

Bugfixing. Refactoring. Removed readonly check for text edits. Styling of text…

Bugfixing. Refactoring. Removed readonly check for text edits. Styling of text edits with jQuery UI.
parent 77962e3c
......@@ -1286,6 +1286,10 @@ define('Graph', ['logme'], function (logme) {
numNotUndefined = 0;
for (c1 = 0; c1 < dataSeries.length; c1 += 1) {
if (dataSeries[c1].bars.show === false) {
continue;
}
if (isFinite(parseInt(dataSeries[c1].data[c0][1])) === true) {
numNotUndefined += 1;
}
......@@ -1293,6 +1297,10 @@ define('Graph', ['logme'], function (logme) {
c3 = 0;
for (c1 = 0; c1 < dataSeries.length; c1 += 1) {
if (dataSeries[c1].bars.show === false) {
continue;
}
dataSeries[c1].data[c0][0] -= graphBarWidth * (0.5 * numNotUndefined - c3);
if (isFinite(parseInt(dataSeries[c1].data[c0][1])) === true) {
......
......@@ -26,7 +26,7 @@ define('Inputs', ['logme'], function (logme) {
return;
function createInput(inputDiv, paramName) {
var paramObj, readOnly;
var paramObj;
paramObj = state.getParamObj(paramName);
......@@ -37,41 +37,25 @@ define('Inputs', ['logme'], function (logme) {
return;
}
readOnly = false;
if (inputDiv.attr('data-el_readonly').toLowerCase() === 'true') {
readOnly = true;
}
if (readOnly === true) {
// In the case of a readonly config option, configure the text
// inputit as read-only, and NOT bind an event to it.
inputDiv.attr('readonly', 'readonly');
inputDiv.css('background-color', '#D3D3D3');
} else { // readonly !== true
// Bind a function to the 'change' event. Whenever the user changes
// the value of this text input, and presses 'enter' (or clicks
// somewhere else on the page), this event will be triggered, and
// our callback will be called.
inputDiv.bind('change', inputOnChange);
}
inputDiv.val(paramObj.value);
// Lets style the input element nicely. We will use the button()
// widget for this since there is no native widget for the text
// input.
// inputDiv.button().css({
// 'font': 'inherit',
// 'color': 'inherit',
// 'text-align': 'left',
// 'outline': 'none',
// 'cursor': 'text',
// 'height': '15px'
// });
inputDiv.button().css({
'font': 'inherit',
'color': 'inherit',
'text-align': 'left',
'outline': 'none',
'cursor': 'text',
'height': '15px'
});
// Tell the parameter object from state that we are attaching a
// 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