Skip to content

Commit

Permalink
[PDF] Fix page rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova authored and K0R0L committed May 26, 2024
1 parent 24800d8 commit 3715c5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/pdfeditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ define([
view.mnuNewPage.on('click', _.bind(me.onNewPage, me));
view.mnuDeletePage.on('click', _.bind(me.onDeletePage, me));
view.mnuRotatePageRight.on('click', _.bind(me.onRotatePage, me, 90));
view.mnuRotatePageLeft.on('click', _.bind(me.onRotatePage, me, 270));
view.mnuRotatePageLeft.on('click', _.bind(me.onRotatePage, me, -90));
view.menuImgReplace.menu.on('item:click', _.bind(me.onImgReplace, me));
}
},
Expand Down Expand Up @@ -551,7 +551,7 @@ define([
var me = this;
_.delay(function(){
if (event.get_Type() == Asc.c_oAscPdfContextMenuTypes.Thumbnails) {
me.mode && me.mode.isEdit && me.mode.isPDFEdit && me.showPopupMenu.call(me, me.documentHolder.pageMenu, {isPageSelect: event.get_IsPageSelect()}, event);
me.mode && me.mode.isEdit && me.mode.isPDFEdit && me.showPopupMenu.call(me, me.documentHolder.pageMenu, {isPageSelect: event.get_IsPageSelect(), pageNum: event.get_PageNum()}, event);
} else
me.showObjectMenu.call(me, event);
},10);
Expand Down Expand Up @@ -2786,8 +2786,8 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
},

onRotatePage: function(angle) {
this.api && this.api.asc_RotatePage(angle);
onRotatePage: function(angle, item) {
this.api && this.api.asc_RotatePage(this.api.asc_GetPageRotate(item.options.value) + angle);

Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
},
Expand Down
1 change: 1 addition & 0 deletions apps/pdfeditor/main/app/view/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,7 @@ define([
restoreHeightAndTop: true,
scrollToCheckedItem: false,
initMenu: function(value) {
me.mnuRotatePageRight.options.value = me.mnuRotatePageLeft.options.value = value.pageNum;
me.mnuRotatePageRight.setVisible(value.isPageSelect===true);
me.mnuRotatePageLeft.setVisible(value.isPageSelect===true);
me.mnuDeletePage.setVisible(value.isPageSelect===true);
Expand Down

0 comments on commit 3715c5d

Please sign in to comment.