Commit a26c9055 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55371 954022d7-b5bf-4e40-9824-e11837661b57
parent 68646166
......@@ -114,6 +114,8 @@ CGroupShape.prototype =
addToSpTree: function(pos, item)
{
if(!isRealNumber(pos))
pos = this.spTree.length;
History.Add(this, {Type: historyitem_GroupShapeAddToSpTree, pos: pos, item: item});
this.spTree.splice(pos, 0, item);
},
......@@ -132,16 +134,25 @@ CGroupShape.prototype =
removeFromSpTree: function(id)
{
for(var i = 0; i < this.spTree.length; ++i)
for(var i = this.spTree.length-1; i > -1 ; --i)
{
if(this.spTree[i].Get_Id() === id)
{
History.Add(this,{Type:historyitem_GroupShapeRemoveFromSpTree, pos: i, item:this.spTree[i]});
this.spTree.splice(i, 1);
return this.spTree.splice(i, 1)[0];
}
}
return null;
},
removeFromSpTreeByPos: function(pos)
{
History.Add(this,{Type:historyitem_GroupShapeRemoveFromSpTree, pos: pos, item:this.spTree[pos]});
return this.spTree.splice(pos, 1)[0];
},
handleUpdateSpTree: function()
{
if(!this.group)
......@@ -1627,26 +1638,76 @@ CGroupShape.prototype =
bringToFront : function()//перемещаем заселекченые объекты наверх
{
var i;
var arrDrawings = [];
for(i = this.spTree.length - 1; i > -1; --i)
{
if(this.spTree[i].getObjectType() === historyitem_type_GroupShape)
{
this.spTree[i].bringToFront();
}
else if(this.spTree[i].selected)
{
arrDrawings.push(this.removeFromSpTreeByPos(i));
}
}
for(i = arrDrawings.length-1; i > -1 ; --i)
{
this.addToSpTree(null, arrDrawings[i]);
}
},
bringForward : function()
{
var i;
for(i = this.spTree.length-1; i > -1; --i)
{
if(this.spTree[i].getObjectType() === historyitem_type_GroupShape)
{
this.spTree[i].bringForward();
}
else if(i < this.spTree.length-1 && this.spTree[i].selected && !this.spTree[i+1].selected)
{
var item = this.removeFromSpTreeByPos(i);
this.addToSpTree(i+1, item);
}
}
},
sendToBack : function()
{
var i, arrDrawings = [];
for(i = this.spTree.length-1; i > -1; --i)
{
if(this.spTree[i].getObjectType() === historyitem_type_GroupShape)
{
this.spTree[i].sendToBack();
}
else if(this.spTree[i].selected)
{
arrDrawings.push(this.removeFromSpTreeByPos(i));
}
}
arrDrawings.reverse();
for(i = 0; i < arrDrawings.length; ++i)
{
this.addToSpTree(i, arrDrawings[i]);
}
},
bringBackward : function()
{
var i;
for(i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].getObjectType() === historyitem_type_GroupShape)
{
this.spTree[i].bringBackward();
}
else if(i > 0 && this.spTree[i].selected && !this.spTree[i-1].selected)
{
this.addToSpTree(i-1, this.removeFromSpTreeByPos(i));
}
}
},
......
This diff is collapsed.
......@@ -220,18 +220,18 @@
<script src="../../../../OfficeWeb/Common/Drawings/TrackObjects/MoveTracks.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/CommonController.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/Constants.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/Format.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/CreateGeometry.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/Geometry.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/Path.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/Shape.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/GroupShape.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/Image.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/Shape.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/ChartSpace.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/ChartFormat.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/Format/TextBody.js"></script>
<script src="../../../../OfficeWeb/Common/Drawings/CommonController.js"></script>
<script src="../../../../OfficeWeb/Excel/view/DrawingObjectsController.js"></script>
<script src="../../../../OfficeWeb/Excel/model/DrawingObjects/Graphics.js"></script>
......
Markdown is supported
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