Bugfixing. Refactoring. Removed readonly check for text edits. Styling of text edits with jQuery UI.

This commit is contained in:
Valera Rozuvan
2013-01-11 15:54:19 +02:00
committed by Alexander Kryklia
parent 77962e3cdb
commit 1770de73f1
2 changed files with 22 additions and 30 deletions

View File

@@ -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) {

View File

@@ -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);
}
// 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