[Embedded] Customize initial zoom for the embedded editors (using customize.zoom parameter in the config)
This commit is contained in:
parent
2fbe4f60b5
commit
607964d068
|
@ -1,7 +1,7 @@
|
||||||
# Change log
|
# Change log
|
||||||
## 5.1.1
|
## 5.1.1
|
||||||
### All Editors
|
### All Editors
|
||||||
*
|
* Customize initial zoom for the embedded editors
|
||||||
|
|
||||||
### Document Editor
|
### Document Editor
|
||||||
* Create and manage bookmarks
|
* Create and manage bookmarks
|
||||||
|
|
|
@ -220,6 +220,9 @@ var ApplicationController = new(function(){
|
||||||
|
|
||||||
hidePreloader();
|
hidePreloader();
|
||||||
|
|
||||||
|
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2);
|
||||||
|
(zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100));
|
||||||
|
|
||||||
if ( !embedConfig.shareUrl )
|
if ( !embedConfig.shareUrl )
|
||||||
$('#idt-share').hide();
|
$('#idt-share').hide();
|
||||||
|
|
||||||
|
@ -338,7 +341,6 @@ var ApplicationController = new(function(){
|
||||||
api.asc_setViewMode(true);
|
api.asc_setViewMode(true);
|
||||||
api.asc_LoadDocument();
|
api.asc_LoadDocument();
|
||||||
api.Resize();
|
api.Resize();
|
||||||
api.zoomFitToWidth();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMask() {
|
function showMask() {
|
||||||
|
|
|
@ -224,6 +224,9 @@ var ApplicationController = new(function(){
|
||||||
}
|
}
|
||||||
hidePreloader();
|
hidePreloader();
|
||||||
|
|
||||||
|
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -1);
|
||||||
|
(zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100));
|
||||||
|
|
||||||
if ( !embedConfig.shareUrl )
|
if ( !embedConfig.shareUrl )
|
||||||
$('#idt-share').hide();
|
$('#idt-share').hide();
|
||||||
|
|
||||||
|
@ -411,7 +414,6 @@ var ApplicationController = new(function(){
|
||||||
api.asc_setViewMode(true);
|
api.asc_setViewMode(true);
|
||||||
api.asc_LoadDocument();
|
api.asc_LoadDocument();
|
||||||
api.Resize();
|
api.Resize();
|
||||||
api.zoomFitToPage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onOpenDocument(progress) {
|
function onOpenDocument(progress) {
|
||||||
|
@ -545,7 +547,6 @@ var ApplicationController = new(function(){
|
||||||
function onDocumentResize() {
|
function onDocumentResize() {
|
||||||
if (api) {
|
if (api) {
|
||||||
api.Resize();
|
api.Resize();
|
||||||
api.zoomFitToPage();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -353,6 +353,8 @@ var ApplicationController = new(function(){
|
||||||
case Asc.c_oAscAsyncAction.Open:
|
case Asc.c_oAscAsyncAction.Open:
|
||||||
if (api) {
|
if (api) {
|
||||||
api.asc_Resize();
|
api.asc_Resize();
|
||||||
|
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom)/100 : 1);
|
||||||
|
api.asc_setZoom(zf>0 ? zf : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDocumentContentReady();
|
onDocumentContentReady();
|
||||||
|
|
Loading…
Reference in a new issue