diff --git a/platform/features/fixed/bundle.js b/platform/features/fixed/bundle.js index e7d72c9095..a158f51083 100644 --- a/platform/features/fixed/bundle.js +++ b/platform/features/fixed/bundle.js @@ -152,65 +152,100 @@ define([ "text": "X", "name": "X", "cssClass": "l-input-sm", +<<<<<<< HEAD "control": "numberfield", "min": "0" +======= + "control": "textfield" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 }, { "property": "editY", "text": "Y", "name": "Y", "cssClass": "l-input-sm", +<<<<<<< HEAD "control": "numberfield", "min": "0" +======= + "control": "textfield" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 }, { "property": "editX1", "text": "X1", "name": "X1", "cssClass": "l-input-sm", +<<<<<<< HEAD "control" : "numberfield", "min": "0" +======= + "control" : "textfield" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 }, { "property": "editY1", "text": "Y1", "name": "Y1", "cssClass": "l-input-sm", +<<<<<<< HEAD "control" : "numberfield", "min": 0 +======= + "control" : "textfield" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 }, { "property": "editX2", "text": "X2", "name": "X2", "cssClass": "l-input-sm", +<<<<<<< HEAD "control" : "numberfield", "min": "0" +======= + "control" : "textfield" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 }, { "property": "editY2", "text": "Y2", "name": "Y2", "cssClass": "l-input-sm", +<<<<<<< HEAD "control" : "numberfield", "min": "0" +======= + "control" : "textfield" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 }, { "property": "editHeight", "text": "H", "name": "H", +<<<<<<< HEAD "cssClass": "l-input-sm", "control": "numberfield", "description": "Resize change object height", "min": "1" +======= + "cssClass": "l-input-sm numerical", + "control": "textfield", + "description": "Resize change object height" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 }, { "property": "editWidth", "text": "W", "name": "W", +<<<<<<< HEAD "cssClass": "l-input-sm", "control": "numberfield", "min": "1" +======= + "cssClass": "l-input-sm numerical", + "control": "textfield" +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 } ] }, diff --git a/platform/features/layout/src/elements/BoxProxy.js b/platform/features/layout/src/elements/BoxProxy.js index 6d80d8c1f9..c63db68d39 100644 --- a/platform/features/layout/src/elements/BoxProxy.js +++ b/platform/features/layout/src/elements/BoxProxy.js @@ -53,10 +53,17 @@ define( proxy.fill = new AccessorMutator(element, 'fill'); //Expose x,y, width and height for editing +<<<<<<< HEAD proxy.editWidth = new AccessorMutator(element, 'width'); proxy.editHeight = new AccessorMutator(element, 'height'); proxy.editX = new AccessorMutator(element, 'x'); proxy.editY = new AccessorMutator(element, 'y'); +======= + proxy.editWidth = new AccessorMutator(element, 'width', proxy.checkNumeric); + proxy.editHeight = new AccessorMutator(element, 'height', proxy.checkNumeric); + proxy.editX = new AccessorMutator(element, 'x', proxy.checkNumeric); + proxy.editY = new AccessorMutator(element, 'y', proxy.checkNumeric); +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 return proxy; } diff --git a/platform/features/layout/src/elements/ElementProxy.js b/platform/features/layout/src/elements/ElementProxy.js index 7d75219adb..a6d3c16aed 100644 --- a/platform/features/layout/src/elements/ElementProxy.js +++ b/platform/features/layout/src/elements/ElementProxy.js @@ -156,6 +156,28 @@ define( return this.resizeHandles; }; + /** + * Ensure and input type is numeric: intended to be passed as the + * updater argument to an AccessorMutator object in order to restrict + * input to integer values only. + * @return Either the string '' (for no input), the new value passed in, + * or the current value of the new value is invalid. + */ + ElementProxy.prototype.checkNumeric = function (value, current) { + var intValue = parseInt(value); + // Handle case of empty field by swapping in 0 + if (value === '') { + return 0; + } + // Else, check if the input is integral, and not, return current value + // of the field + if (isNaN(intValue)) { + return current; + } else { + return intValue; + } + }; + return ElementProxy; } ); diff --git a/platform/features/layout/src/elements/ImageProxy.js b/platform/features/layout/src/elements/ImageProxy.js index 3c589b8fe4..06827fbdcb 100644 --- a/platform/features/layout/src/elements/ImageProxy.js +++ b/platform/features/layout/src/elements/ImageProxy.js @@ -50,10 +50,17 @@ define( proxy.url = new AccessorMutator(element, 'url'); //Expose width and height properties for editing +<<<<<<< HEAD proxy.editWidth = new AccessorMutator(element, 'width'); proxy.editHeight = new AccessorMutator(element, 'height'); proxy.editX = new AccessorMutator(element, 'x'); proxy.editY = new AccessorMutator(element, 'y'); +======= + proxy.editWidth = new AccessorMutator(element, 'width', proxy.checkNumeric); + proxy.editHeight = new AccessorMutator(element, 'height', proxy.checkNumeric); + proxy.editX = new AccessorMutator(element, 'x', proxy.checkNumeric); + proxy.editY = new AccessorMutator(element, 'y', proxy.checkNumeric); +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 return proxy; } diff --git a/platform/features/layout/src/elements/LineProxy.js b/platform/features/layout/src/elements/LineProxy.js index e121561061..431296ad8b 100644 --- a/platform/features/layout/src/elements/LineProxy.js +++ b/platform/features/layout/src/elements/LineProxy.js @@ -149,10 +149,17 @@ define( }; // Expose endpoint coordinates for editing +<<<<<<< HEAD proxy.editX1 = new AccessorMutator(element, 'x'); proxy.editY1 = new AccessorMutator(element, 'y'); proxy.editX2 = new AccessorMutator(element, 'x2'); proxy.editY2 = new AccessorMutator(element, 'y2'); +======= + proxy.editX1 = new AccessorMutator(element, 'x', proxy.checkNumeric); + proxy.editY1 = new AccessorMutator(element, 'y', proxy.checkNumeric); + proxy.editX2 = new AccessorMutator(element, 'x2', proxy.checkNumeric); + proxy.editY2 = new AccessorMutator(element, 'y2', proxy.checkNumeric); +>>>>>>> 39fe2fd7b6f0fd79e7f75ae9d04ba20d74d8e2c5 return proxy; }