[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 **/
var menuAddCommentPara = new Common.UI.MenuItem({
caption : me.addCommentText
@ -3178,6 +3220,10 @@ define([
disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked),
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
menuImgOriginalSize.setVisible(isimage);
if (menuImgOriginalSize.isVisible())
@ -3218,6 +3264,7 @@ define([
{ caption: '--' },
menuImgShapeArrange,
menuImgShapeAlign,
menuImgShapeRotate,
menuImgShapeSeparator,
menuImgOriginalSize,
menuImgReplace,
@ -3479,7 +3526,12 @@ define([
textDistributeCols: 'Distribute columns',
textReplace: 'Replace image',
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 || {}));
});

View file

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

View file

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

View file

@ -1104,6 +1104,11 @@
"PE.Views.DocumentHolder.txtUnderbar": "Bar under text",
"PE.Views.DocumentHolder.txtUngroup": "Ungroup",
"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.slideIndexText": "Slide {0} of {1}",
"PE.Views.DocumentPreview.txtClose": "Close slideshow",