Commit 39595617 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Merge branch 'noc-1644' into 'master'

noc/noc#1644

See merge request noc/noc!5643
parents 6c5a6c8f ba3fc936
Pipeline #33040 failed with stages
in 63 minutes and 11 seconds
...@@ -223,7 +223,7 @@ Ext.define("NOC.core.ListFormField", { ...@@ -223,7 +223,7 @@ Ext.define("NOC.core.ListFormField", {
}, },
afterrender: function(self) { afterrender: function(self) {
var me = this; var me = this;
me.panel.setMaxHeight((self.getHeight() + 6) * me.rows + 6); me.panel.setHeight((self.getHeight() + 6) * me.rows + 6);
} }
} }
}); });
......
...@@ -296,8 +296,8 @@ Ext.define("NOC.core.label.LabelField", { ...@@ -296,8 +296,8 @@ Ext.define("NOC.core.label.LabelField", {
} }
} }
} }
return me.callParent([value, add]);
} }
return me.callParent([value, add]);
}, },
toClipboard: function(btn) { toClipboard: function(btn) {
......
...@@ -174,7 +174,6 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", { ...@@ -174,7 +174,6 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", {
mainPanel.unmask(); mainPanel.unmask();
NOC.msg.complete(__("The data was successfully loaded")); NOC.msg.complete(__("The data was successfully loaded"));
mainPanel.drawPanel.getSurface().removeAll(); mainPanel.drawPanel.getSurface().removeAll();
mainPanel.drawPanel.getSurface("wires").removeAll();
if(!isValid(data.right.connections, rightSelected)) { if(!isValid(data.right.connections, rightSelected)) {
mainPanel.getViewModel().set("rightSelectedPin", null); mainPanel.getViewModel().set("rightSelectedPin", null);
mainPanel.getViewModel().set("rightSelectedPinId", null); mainPanel.getViewModel().set("rightSelectedPinId", null);
...@@ -194,7 +193,7 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", { ...@@ -194,7 +193,7 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", {
mainPanel.drawObject(data.right.connections, mainPanel.drawObject(data.right.connections,
mainPanel.getWidth() / 2 + 100, mainPanel.getWidth() / 2 + 100,
"right", maxPins)); "right", maxPins));
mainPanel.drawPanel.getSurface("wires").add(mainPanel.drawWire(data.wires)); mainPanel.drawPanel.getSurface().add(mainPanel.drawWire(data.wires));
} }
mainPanel.drawPanel.renderFrame(); mainPanel.drawPanel.renderFrame();
}, },
...@@ -308,7 +307,8 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", { ...@@ -308,7 +307,8 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", {
toX: rightPort.x + rightPort.box.width / 2, toX: rightPort.x + rightPort.box.width / 2,
toY: rightPort.y + rightPort.box.height / 2, toY: rightPort.y + rightPort.box.height / 2,
strokeStyle: mainPanel.WIRE_COLOR, strokeStyle: mainPanel.WIRE_COLOR,
lineWidth: 2 lineWidth: 2,
zIndex: 10,
}); });
}); });
return sprites; return sprites;
...@@ -376,14 +376,14 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", { ...@@ -376,14 +376,14 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", {
scale: 1.02, scale: 1.02,
labelBold: true, labelBold: true,
}); });
Ext.each(me.drawPanel.getSurface("wires").getItems(), function(sprite) { Ext.each(me.drawPanel.getSurface().getItems(), function(sprite) {
if(sprite.config.leftPortId === pin.sprite.id || sprite.config.rightPortId === pin.sprite.id) { if(sprite.config.leftPortId === pin.sprite.id || sprite.config.rightPortId === pin.sprite.id) {
sprite.setAttributes({ sprite.setAttributes({
strokeStyle: me.SELECTED_WIRE_COLOR, strokeStyle: me.SELECTED_WIRE_COLOR,
lineWidth: 4, lineWidth: 4,
zIndex: 100, zIndex: 100,
}); });
me.drawPanel.getSurface("wires").renderFrame(); me.drawPanel.getSurface().renderFrame();
return false; return false;
} }
}); });
...@@ -397,14 +397,14 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", { ...@@ -397,14 +397,14 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", {
scale: 1, scale: 1,
labelBold: false, labelBold: false,
}); });
Ext.each(me.drawPanel.getSurface("wires").getItems(), function(sprite) { Ext.each(me.drawPanel.getSurface().getItems(), function(sprite) {
if(sprite.config.leftPortId === pin.sprite.id || sprite.config.rightPortId === pin.sprite.id) { if(sprite.config.leftPortId === pin.sprite.id || sprite.config.rightPortId === pin.sprite.id) {
sprite.setAttributes({ sprite.setAttributes({
strokeStyle: me.WIRE_COLOR, strokeStyle: me.WIRE_COLOR,
lineWidth: 2, lineWidth: 2,
zIndex: 0, zIndex: 10,
}); });
me.drawPanel.getSurface("wires").renderFrame(); me.drawPanel.getSurface().renderFrame();
} }
}); });
} }
...@@ -454,10 +454,8 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", { ...@@ -454,10 +454,8 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", {
me.getViewModel().set("leftSelectedPinId", null); me.getViewModel().set("leftSelectedPinId", null);
me.getViewModel().set("rightSelectedPin", null); me.getViewModel().set("rightSelectedPin", null);
me.getViewModel().set("rightSelectedPinId", null); me.getViewModel().set("rightSelectedPinId", null);
me.drawPanel.getSurface("wires").removeAll(true); me.drawPanel.removeAll(true);
me.drawPanel.getSurface().removeAll(true); me.drawPanel.renderFrame();
me.drawPanel.getSurface().renderFrame();
me.drawPanel.getSurface("wires").renderFrame();
}, },
onReload: function() { onReload: function() {
this.load(); this.load();
...@@ -487,7 +485,7 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", { ...@@ -487,7 +485,7 @@ Ext.define("NOC.inv.inv.CreateConnectionForm", {
jsonData: param, jsonData: param,
scope: me, scope: me,
success: function() { success: function() {
this.drawPanel.getSurface("wires").add(this.drawWire([ this.drawPanel.getSurface().add(this.drawWire([
{ {
left: {id: leftPinId}, right: {id: rightPinId} left: {id: leftPinId}, right: {id: rightPinId}
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment