mirror of
https://github.com/nasa/openmct.git
synced 2025-04-29 15:30:07 +00:00
[Layout] Code style
Fix code style issues
This commit is contained in:
parent
5f7eeeae30
commit
b661b4737e
@ -155,7 +155,7 @@ define([
|
|||||||
"control": "textfield"
|
"control": "textfield"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"property":"editY",
|
"property": "editY",
|
||||||
"text": "Y",
|
"text": "Y",
|
||||||
"name": "Y",
|
"name": "Y",
|
||||||
"cssClass": "l-input-sm",
|
"cssClass": "l-input-sm",
|
||||||
@ -202,13 +202,12 @@ define([
|
|||||||
"text": "W",
|
"text": "W",
|
||||||
"name": "W",
|
"name": "W",
|
||||||
"cssClass": "l-input-sm numerical",
|
"cssClass": "l-input-sm numerical",
|
||||||
"control": "textfield",
|
"control": "textfield"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"items":[
|
"items": [
|
||||||
{
|
{
|
||||||
"property": "text",
|
"property": "text",
|
||||||
"cssClass": "icon-gear",
|
"cssClass": "icon-gear",
|
||||||
|
@ -53,10 +53,10 @@ define(
|
|||||||
proxy.fill = new AccessorMutator(element, 'fill');
|
proxy.fill = new AccessorMutator(element, 'fill');
|
||||||
|
|
||||||
//Expose x,y, width and height for editing
|
//Expose x,y, width and height for editing
|
||||||
proxy.editWidth = new AccessorMutator(element,'width', proxy.checkNumeric);
|
proxy.editWidth = new AccessorMutator(element, 'width', proxy.checkNumeric);
|
||||||
proxy.editHeight = new AccessorMutator(element,'height', proxy.checkNumeric);
|
proxy.editHeight = new AccessorMutator(element, 'height', proxy.checkNumeric);
|
||||||
proxy.editX = new AccessorMutator(element,'x',proxy.checkNumeric);
|
proxy.editX = new AccessorMutator(element, 'x', proxy.checkNumeric);
|
||||||
proxy.editY = new AccessorMutator(element,'y', proxy.checkNumeric);
|
proxy.editY = new AccessorMutator(element,' y', proxy.checkNumeric);
|
||||||
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
@ -163,15 +163,15 @@ define(
|
|||||||
* @return Either the string '' (for no input), the new value passed in,
|
* @return Either the string '' (for no input), the new value passed in,
|
||||||
* or the current value of the new value is invalid.
|
* or the current value of the new value is invalid.
|
||||||
*/
|
*/
|
||||||
ElementProxy.prototype.checkNumeric = function(value, current) {
|
ElementProxy.prototype.checkNumeric = function (value, current) {
|
||||||
var intValue = parseInt(value);
|
var intValue = parseInt(value);
|
||||||
// Handle case of empty field by swapping in 0
|
// Handle case of empty field by swapping in 0
|
||||||
if (value === ''){
|
if (value === '') {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// Else, check if the input is integral, and not, return current value
|
// Else, check if the input is integral, and not, return current value
|
||||||
// of the field
|
// of the field
|
||||||
if ( isNaN(intValue) ){
|
if (isNaN(intValue)) {
|
||||||
return current;
|
return current;
|
||||||
} else {
|
} else {
|
||||||
return intValue;
|
return intValue;
|
||||||
|
@ -52,8 +52,8 @@ define(
|
|||||||
//Expose width and height properties for editing
|
//Expose width and height properties for editing
|
||||||
proxy.editWidth = new AccessorMutator(element, 'width', proxy.checkNumeric);
|
proxy.editWidth = new AccessorMutator(element, 'width', proxy.checkNumeric);
|
||||||
proxy.editHeight = new AccessorMutator(element, 'height', proxy.checkNumeric);
|
proxy.editHeight = new AccessorMutator(element, 'height', proxy.checkNumeric);
|
||||||
proxy.editX = new AccessorMutator(element,'x',proxy.checkNumeric);
|
proxy.editX = new AccessorMutator(element, 'x', proxy.checkNumeric);
|
||||||
proxy.editY = new AccessorMutator(element,'y', proxy.checkNumeric);
|
proxy.editY = new AccessorMutator(element,' y', proxy.checkNumeric);
|
||||||
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
@ -149,10 +149,10 @@ define(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Expose endpoint coordinates for editing
|
// Expose endpoint coordinates for editing
|
||||||
proxy.editX1 = new AccessorMutator(element,'x', proxy.checkNumeric);
|
proxy.editX1 = new AccessorMutator(element, 'x', proxy.checkNumeric);
|
||||||
proxy.editY1 = new AccessorMutator(element,'y', proxy.checkNumeric);
|
proxy.editY1 = new AccessorMutator(element, 'y', proxy.checkNumeric);
|
||||||
proxy.editX2 = new AccessorMutator(element,'x2', proxy.checkNumeric);
|
proxy.editX2 = new AccessorMutator(element, 'x2', proxy.checkNumeric);
|
||||||
proxy.editY2 = new AccessorMutator(element,'y2', proxy.checkNumeric);
|
proxy.editY2 = new AccessorMutator(element, 'y2', proxy.checkNumeric);
|
||||||
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user