Commit 94a45a7e authored by Oleg Korshul's avatar Oleg Korshul Committed by GitHub

Merge branch 'feature/notes' into develop

parents 2d3dd8e7 79c46949
......@@ -585,9 +585,8 @@ function CEditorPage(api)
this.initEvents();
this.OnResize(true);
this.setNodesEnable(false);
//this.m_oNotesApi = new CNotesDrawer(this);
//this.m_oNotesApi.Init();
this.m_oNotesApi = new CNotesDrawer(this);
this.m_oNotesApi.Init();
};
this.CheckRetinaDisplay = function()
......@@ -897,7 +896,6 @@ function CEditorPage(api)
if (_value < 5)
_value = 5;
return _value;
};
......@@ -908,7 +906,6 @@ function CEditorPage(api)
return;
var _new_value = this.zoom_FitToWidth_value();
if (_new_value != this.m_nZoomValue)
{
this.m_nZoomValue = _new_value;
......
......@@ -44,7 +44,7 @@
//Temporary function
function GetNotesWidth(){
return editor.WordControl.m_oNotes.HtmlElement.width/g_dKoef_mm_to_pix;
return editor.WordControl.m_oDrawingDocument.Notes_GetWidth();
}
function CNotes(){
......
......@@ -520,6 +520,8 @@ function CPresentation(DrawingDocument)
this.clrMru = [];
this.prnPr = null;
this.showPr = null;
this.NotesWidth = -10;
}
CPresentation.prototype =
......@@ -3948,6 +3950,9 @@ CPresentation.prototype =
{
this.Slides[oldCurPage].graphicObjects.resetSelectionState();
}
if(!this.Notes_OnResize()){
this.DrawingDocument.Notes_OnRecalculate(this.CurPage, this.Slides[this.CurPage].NotesWidth, this.Slides[this.CurPage].getNotesHeight());
}
editor.asc_hideComments();
this.Document_UpdateInterfaceState();
}
......@@ -3962,6 +3967,39 @@ CPresentation.prototype =
{
this.Slides[this.CurPage] && this.Slides[this.CurPage].graphicObjects.resetSelection();
},
///NOTES
Notes_OnResize: function(){
if(!this.Slides[this.CurPage]){
return false;
}
var oCurSlide = this.Slides[this.CurPage];
var newNotesWidth = this.DrawingDocument.Notes_GetWidth();
if(AscFormat.fApproxEqual(oCurSlide.NotesWidth, newNotesWidth)){
return false;
}
oCurSlide.NotesWidth = newNotesWidth;
oCurSlide.recalculateNotesShape();
this.DrawingDocument.Notes_OnRecalculate(this.CurPage, newNotesWidth, oCurSlide.getNotesHeight());
return true;
},
Notes_GetHeight: function(){
if(!this.Slide[this.CurPage]){
return 0;
}
return this.Slides[this.CurPage].getNotesHeight();
},
Notes_Draw: function(SlideIndex, graphics){
if(this.Slides[SlideIndex]){
this.Slides[SlideIndex].drawNotes(graphics);
}
},
//-----------------------------------------------------------------------------------
// Undo/Redo функции
//-----------------------------------------------------------------------------------
......
......@@ -206,6 +206,8 @@ function Slide(presentation, slideLayout, slideNum)
this.lastLayoutMatchingName = null;
this.lastLayoutName = null;
this.NotesWidth = -10.0;
if(presentation)
{
this.Width = presentation.Width;
......@@ -1021,6 +1023,18 @@ Slide.prototype =
this.cSld.spTree[i].recalculate();
},
getNotesHeight: function(){
if(!this.notesShape){
return 0;
}
var oDocContent = this.notesShape.getDocContent();
if(oDocContent){
return oDocContent.Get_SummaryHeight();
}
return 0;
},
recalculateNotesShape: function(){
AscFormat.ExecuteNoHistory(function(){
if(!this.notes){
......@@ -1076,8 +1090,12 @@ Slide.prototype =
}
}
return;
},
drawNotes: function (g) {
if(this.notesShape){
this.notesShape.draw(graphics);
this.notesShape.draw(g);
}
},
......
......@@ -1351,7 +1351,7 @@ background-repeat: no-repeat;\
<div id=\"id_buttonPrevPage\" class=\"block_elem buttonPrevPage\"></div>\
<div id=\"id_buttonNextPage\" class=\"block_elem buttonNextPage\"></div>\
</div>\
<div id=\"id_horscrollpanel\" class=\"block_elem\" style=\"margin-bottom:1px;background-color:#B0B0B0;\">\
<div id=\"id_horscrollpanel\" class=\"block_elem\" style=\"margin-bottom:1px;background-color:#F1F1F1;\">\
<div id=\"id_horizontal_scroll\" style=\"left:0;top:0;height:14px;overflow:hidden;position:absolute;width:100%;\">\
<div id=\"panel_hor_scroll\" class=\"block_elem\" style=\"left:0;top:0;width:6000px;height:1px;\"></div>\
</div>\
......@@ -5546,7 +5546,7 @@ background-repeat: no-repeat;\
return;
}
//this.WordControl.setNodesEnable((this.isViewMode || this.isMobileVersion) ? false : true);
this.WordControl.setNodesEnable((this.isViewMode || this.isMobileVersion) ? false : true);
if (isViewMode)
{
this.ShowParaMarks = false;
......
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