diff --git a/platform/features/fixed/bundle.js b/platform/features/fixed/bundle.js index 9d803b2f05..91cd8dc119 100644 --- a/platform/features/fixed/bundle.js +++ b/platform/features/fixed/bundle.js @@ -148,21 +148,21 @@ define([ { "items": [ { - "property": "x", + "property": "editX", "text": "X", "name": "X", "cssClass": "l-input-sm", "control": "textfield" }, { - "property":"y", + "property":"editY", "text": "Y", "name": "Y", "cssClass": "l-input-sm", "control": "textfield" }, { - "property": "x1", + "method": "editX1", "text": "X1", "name": "X1", "cssClass": "l-input-sm", diff --git a/platform/features/layout/src/elements/BoxProxy.js b/platform/features/layout/src/elements/BoxProxy.js index 01ba57a6df..69431a834e 100644 --- a/platform/features/layout/src/elements/BoxProxy.js +++ b/platform/features/layout/src/elements/BoxProxy.js @@ -52,9 +52,11 @@ define( */ proxy.fill = new AccessorMutator(element, 'fill'); - //Expose width and height for editing + //Expose x,y, width and height for editing 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); return proxy; } diff --git a/platform/features/layout/src/elements/ElementProxy.js b/platform/features/layout/src/elements/ElementProxy.js index e3c8613ec9..bb66186f82 100644 --- a/platform/features/layout/src/elements/ElementProxy.js +++ b/platform/features/layout/src/elements/ElementProxy.js @@ -164,17 +164,17 @@ define( * or the current value of the new value is invalid. */ ElementProxy.prototype.checkNumeric = function(value, current) { - // Allow field to be empty + 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 - value = parseInt(value); - if ( isNaN(value) ){ + if ( isNaN(intValue) ){ return current; } else { - return value; + return intValue; } }; diff --git a/platform/features/layout/src/elements/ImageProxy.js b/platform/features/layout/src/elements/ImageProxy.js index 218462e9b3..fd5d77728e 100644 --- a/platform/features/layout/src/elements/ImageProxy.js +++ b/platform/features/layout/src/elements/ImageProxy.js @@ -52,6 +52,8 @@ define( //Expose width and height properties for editing 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); return proxy; }