Conversation
Few fixes for requirejs config to make JointJS load properly. Also jQuery updated to 2.2.4.
TanVD
left a comment
There was a problem hiding this comment.
Good. Minor fixes requested.
| private imagePath: string; | ||
| private propertyEditElement: PropertyEditElement; | ||
| private propertyEditElements: PropertyEditElement[]; | ||
| private delta = 20; |
There was a problem hiding this comment.
Delta of what? Not very helpful name.
| private propertyEditElement: PropertyEditElement; | ||
| private propertyEditElements: PropertyEditElement[]; | ||
| private delta = 20; | ||
| private topIndent = 30; |
| setPropertyEditElementsPosition(x : number, y : number) : void { | ||
| let propertiesCount = 0; | ||
|
|
||
| for (let i in this.propertyEditElements) { |
There was a problem hiding this comment.
You can either use here for ... of construction or use i variable also as propertiesCount
| this.propertyEditElement.setPosition(propertyEditElementX, propertyEditElementY); | ||
| var propertyEditElementY = parentPosition.y + this.boundingBox.height - this.topIndent; | ||
|
|
||
| for (var propertyKey in this.changeableProperties) { |
There was a problem hiding this comment.
As IDEA reminds: it's better to use let instead of var cause it behaves more strictly.
| var parentPosition = this.getJointObjectPagePosition(zoom); | ||
| this.propertyEditElement = new PropertyEditElement(this.logicalId, this.jointObject.id, | ||
| this.changeableProperties); | ||
| var propertyEditElementX = parentPosition.x + (<number> (this.boundingBox.width - 50)/2); |
There was a problem hiding this comment.
Extract magic number to appropriate constant.
| node.getPropertyEditElement().getHtmlElement().remove(); | ||
| if (node.getPropertyEditElements()) { | ||
| var editElements = node.getPropertyEditElements(); | ||
| for (let i in editElements) { |
| node.getJointObject().remove(); | ||
| if (node.getPropertyEditElement()) { | ||
| node.getPropertyEditElement().getHtmlElement().remove(); | ||
| if (node.getPropertyEditElements()) { |
There was a problem hiding this comment.
What does it mean? Is it check for null or what? Use explicit syntax.
| node.initPropertyEditElements(this.zoom); | ||
| if (node.getPropertyEditElement()) { | ||
| node.getPropertyEditElement().getHtmlElement().insertBefore("#" + this.getId()); | ||
| if (node.getPropertyEditElements()) { |
…ties # Conflicts: # editor-core/src/main/webapp/app/core/editorCore/model/DefaultDiagramNode.ts # editor-core/src/main/webapp/app/core/editorCore/model/DiagramNode.ts
TanVD
left a comment
There was a problem hiding this comment.
Please repair:
- Changing of proprerty will move it to default postion
- Saving of property will move it to default position
Fixes requested.
| changeTextPosition() : void { | ||
| var dx = this.getX() - this.lastPointermoveCursor.x; | ||
| var dy = this.getY() - this.lastPointermoveCursor.y; | ||
| console.log("Diagram pos in changeTextPosition : " + this.getX() + ", " + this.getY()); |
There was a problem hiding this comment.
We do not use log levels, so it's better to remove unnecessary logs before merge to master.
| private jointObject: ImageWithPorts; | ||
|
|
||
| /** | ||
| * Name and type of diagramm. |
There was a problem hiding this comment.
Write one doc per one field.
| private constPropertiesPack: PropertiesPack; | ||
|
|
||
| /** | ||
| * Properties, which can be changes by user. |
| private changeableProperties: Map<String, Property>; | ||
|
|
||
| /** | ||
| * Path to image. |
There was a problem hiding this comment.
Not really helpful. What kind of path? Filepath, url?
| private parentNode: DiagramContainer; | ||
|
|
||
| /** | ||
| * Graph, where diagram is located. Used to set new properties on the screen. |
| var diffY = y - this.lastMousePosition.y; | ||
| this.lastPointermoveCursor.x = this.getX(); | ||
| this.lastPointermoveCursor.y = this.getY(); | ||
| this.lastDiagramPosition.x = this.getX(); |
There was a problem hiding this comment.
Position of the whole diagram? Maybe lastCursorPosition?
There was a problem hiding this comment.
Position of the whole diagram? -- Yes. Coordinates of underlying joint object.
No description provided.