[PE] Bug 19378 (add rotation to context menu)

This commit is contained in:
Julia Radzhabova 2019-02-26 19:36:02 +03:00
parent 292fba4783
commit 57c70bbb02
4 changed files with 62 additions and 5 deletions

View file

@ -2777,6 +2777,48 @@ define([
}) })
}); });
var onImgRotate = function(item) {
var properties = new Asc.asc_CShapeProperty();
properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180);
me.api.ShapeApply(properties);
me.fireEvent('editcomplete', me);
};
var onImgFlip = function(item) {
var properties = new Asc.asc_CShapeProperty();
if (item.value==1)
properties.asc_putFlipHInvert(true);
else
properties.asc_putFlipVInvert(true);
me.api.ShapeApply(properties);
me.fireEvent('editcomplete', me);
};
var menuImgShapeRotate = new Common.UI.MenuItem({
caption : me.textRotate,
menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items: [
new Common.UI.MenuItem({
caption: me.textRotate270,
value : 0
}).on('click', _.bind(onImgRotate, me)),
new Common.UI.MenuItem({
caption: me.textRotate90,
value : 1
}).on('click', _.bind(onImgRotate, me)),
new Common.UI.MenuItem({
caption: me.textFlipH,
value : 1
}).on('click', _.bind(onImgFlip, me)),
new Common.UI.MenuItem({
caption: me.textFlipV,
value : 0
}).on('click', _.bind(onImgFlip, me))
]
})
});
/** coauthoring begin **/ /** coauthoring begin **/
var menuAddCommentPara = new Common.UI.MenuItem({ var menuAddCommentPara = new Common.UI.MenuItem({
caption : me.addCommentText caption : me.addCommentText
@ -3178,6 +3220,10 @@ define([
disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked), disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked),
pluginGuid = (value.imgProps) ? value.imgProps.value.asc_getPluginGuid() : null; pluginGuid = (value.imgProps) ? value.imgProps.value.asc_getPluginGuid() : null;
menuImgShapeRotate.setVisible(_.isUndefined(value.chartProps) && (pluginGuid===null || pluginGuid===undefined));
if (menuImgShapeRotate.isVisible())
menuImgShapeRotate.setDisabled(disabled);
// image properties // image properties
menuImgOriginalSize.setVisible(isimage); menuImgOriginalSize.setVisible(isimage);
if (menuImgOriginalSize.isVisible()) if (menuImgOriginalSize.isVisible())
@ -3218,6 +3264,7 @@ define([
{ caption: '--' }, { caption: '--' },
menuImgShapeArrange, menuImgShapeArrange,
menuImgShapeAlign, menuImgShapeAlign,
menuImgShapeRotate,
menuImgShapeSeparator, menuImgShapeSeparator,
menuImgOriginalSize, menuImgOriginalSize,
menuImgReplace, menuImgReplace,
@ -3479,7 +3526,12 @@ define([
textDistributeCols: 'Distribute columns', textDistributeCols: 'Distribute columns',
textReplace: 'Replace image', textReplace: 'Replace image',
textFromUrl: 'From URL', textFromUrl: 'From URL',
textFromFile: 'From File' textFromFile: 'From File',
textRotate270: 'Rotate Left 90°',
textRotate90: 'Rotate Right 90°',
textFlipV: 'Flip Vertically',
textFlipH: 'Flip Horizontally',
textRotate: 'Rotation'
}, PE.Views.DocumentHolder || {})); }, PE.Views.DocumentHolder || {}));
}); });

View file

@ -360,8 +360,8 @@ define([
textFlip: 'Flip', textFlip: 'Flip',
textHint270: 'Rotate Left 90°', textHint270: 'Rotate Left 90°',
textHint90: 'Rotate Right 90°', textHint90: 'Rotate Right 90°',
textHintFlipV: 'Flip Vertical', textHintFlipV: 'Flip Vertically',
textHintFlipH: 'Flip Horizontal' textHintFlipH: 'Flip Horizontally'
}, PE.Views.ImageSettings || {})); }, PE.Views.ImageSettings || {}));
}); });

View file

@ -1710,7 +1710,7 @@ define([
textFlip: 'Flip', textFlip: 'Flip',
textHint270: 'Rotate Left 90°', textHint270: 'Rotate Left 90°',
textHint90: 'Rotate Right 90°', textHint90: 'Rotate Right 90°',
textHintFlipV: 'Flip Vertical', textHintFlipV: 'Flip Vertically',
textHintFlipH: 'Flip Horizontal' textHintFlipH: 'Flip Horizontally'
}, PE.Views.ShapeSettings || {})); }, PE.Views.ShapeSettings || {}));
}); });

View file

@ -1104,6 +1104,11 @@
"PE.Views.DocumentHolder.txtUnderbar": "Bar under text", "PE.Views.DocumentHolder.txtUnderbar": "Bar under text",
"PE.Views.DocumentHolder.txtUngroup": "Ungroup", "PE.Views.DocumentHolder.txtUngroup": "Ungroup",
"PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", "PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"PE.Views.DocumentHolder.textRotate270": "Rotate Left 90°",
"PE.Views.DocumentHolder.textRotate90": "Rotate Right 90°",
"PE.Views.DocumentHolder.textFlipV": "Flip Vertically",
"PE.Views.DocumentHolder.textFlipH": "Flip Horizontally",
"PE.Views.DocumentHolder.textRotate": "Rotation",
"PE.Views.DocumentPreview.goToSlideText": "Go to Slide", "PE.Views.DocumentPreview.goToSlideText": "Go to Slide",
"PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}", "PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}",
"PE.Views.DocumentPreview.txtClose": "Close slideshow", "PE.Views.DocumentPreview.txtClose": "Close slideshow",