[DE] Bug 19378 (add rotation to context menu)
This commit is contained in:
parent
8e956a7ce8
commit
292fba4783
|
@ -2357,6 +2357,31 @@ define([
|
||||||
var menuSignatureEditSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }).on('click', _.bind(me.onSignatureClick, me));
|
var menuSignatureEditSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }).on('click', _.bind(me.onSignatureClick, me));
|
||||||
var menuEditSignSeparator = new Common.UI.MenuItem({ caption: '--' });
|
var menuEditSignSeparator = new Common.UI.MenuItem({ caption: '--' });
|
||||||
|
|
||||||
|
var menuImgRotate = new Common.UI.MenuItem({
|
||||||
|
caption : me.textRotate,
|
||||||
|
menu : new Common.UI.Menu({
|
||||||
|
menuAlign: 'tl-tr',
|
||||||
|
items: [
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption: this.textRotate270,
|
||||||
|
value : 0
|
||||||
|
}).on('click', _.bind(me.onImgRotate, me)),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption: this.textRotate90,
|
||||||
|
value : 1
|
||||||
|
}).on('click', _.bind(me.onImgRotate, me)),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption: this.textFlipH,
|
||||||
|
value : 1
|
||||||
|
}).on('click', _.bind(me.onImgFlip, me)),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
caption: this.textFlipV,
|
||||||
|
value : 0
|
||||||
|
}).on('click', _.bind(me.onImgFlip, me))
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
this.pictureMenu = new Common.UI.Menu({
|
this.pictureMenu = new Common.UI.Menu({
|
||||||
initMenu: function(value){
|
initMenu: function(value){
|
||||||
if (_.isUndefined(value.imgProps))
|
if (_.isUndefined(value.imgProps))
|
||||||
|
@ -2417,16 +2442,20 @@ define([
|
||||||
|
|
||||||
me.menuOriginalSize.setVisible(value.imgProps.isOnlyImg || !value.imgProps.isChart && !value.imgProps.isShape);
|
me.menuOriginalSize.setVisible(value.imgProps.isOnlyImg || !value.imgProps.isChart && !value.imgProps.isShape);
|
||||||
|
|
||||||
|
var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked);
|
||||||
var pluginGuid = value.imgProps.value.asc_getPluginGuid();
|
var pluginGuid = value.imgProps.value.asc_getPluginGuid();
|
||||||
menuImgReplace.setVisible(value.imgProps.isOnlyImg && (pluginGuid===null || pluginGuid===undefined));
|
menuImgReplace.setVisible(value.imgProps.isOnlyImg && (pluginGuid===null || pluginGuid===undefined));
|
||||||
if (menuImgReplace.isVisible())
|
if (menuImgReplace.isVisible())
|
||||||
menuImgReplace.setDisabled(islocked || pluginGuid===null);
|
menuImgReplace.setDisabled(islocked || pluginGuid===null);
|
||||||
|
|
||||||
var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked);
|
menuImgRotate.setVisible(!value.imgProps.isChart && (pluginGuid===null || pluginGuid===undefined));
|
||||||
|
if (menuImgRotate.isVisible())
|
||||||
|
menuImgRotate.setDisabled(islocked);
|
||||||
|
|
||||||
if (menuChartEdit.isVisible())
|
if (menuChartEdit.isVisible())
|
||||||
menuChartEdit.setDisabled(islocked || value.imgProps.value.get_SeveralCharts());
|
menuChartEdit.setDisabled(islocked || value.imgProps.value.get_SeveralCharts());
|
||||||
|
|
||||||
me.pictureMenu.items[14].setVisible(menuChartEdit.isVisible());
|
me.pictureMenu.items[15].setVisible(menuChartEdit.isVisible());
|
||||||
|
|
||||||
me.menuOriginalSize.setDisabled(islocked || value.imgProps.value.get_ImageUrl()===null || value.imgProps.value.get_ImageUrl()===undefined);
|
me.menuOriginalSize.setDisabled(islocked || value.imgProps.value.get_ImageUrl()===null || value.imgProps.value.get_ImageUrl()===undefined);
|
||||||
menuImageAdvanced.setDisabled(islocked);
|
menuImageAdvanced.setDisabled(islocked);
|
||||||
|
@ -2474,6 +2503,7 @@ define([
|
||||||
menuImageArrange,
|
menuImageArrange,
|
||||||
menuImageAlign,
|
menuImageAlign,
|
||||||
me.menuImageWrap,
|
me.menuImageWrap,
|
||||||
|
menuImgRotate,
|
||||||
{ caption: '--' },
|
{ caption: '--' },
|
||||||
me.menuOriginalSize,
|
me.menuOriginalSize,
|
||||||
menuImgReplace,
|
menuImgReplace,
|
||||||
|
@ -3698,6 +3728,23 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onImgRotate: function(item) {
|
||||||
|
var properties = new Asc.asc_CImgProperty();
|
||||||
|
properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180);
|
||||||
|
this.api.ImgApply(properties);
|
||||||
|
this.fireEvent('editcomplete', this);
|
||||||
|
},
|
||||||
|
|
||||||
|
onImgFlip: function(item) {
|
||||||
|
var properties = new Asc.asc_CImgProperty();
|
||||||
|
if (item.value==1)
|
||||||
|
properties.asc_putFlipHInvert(true);
|
||||||
|
else
|
||||||
|
properties.asc_putFlipVInvert(true);
|
||||||
|
this.api.ImgApply(properties);
|
||||||
|
this.fireEvent('editcomplete', this);
|
||||||
|
},
|
||||||
|
|
||||||
focus: function() {
|
focus: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
_.defer(function(){ me.cmpEl.focus(); }, 50);
|
_.defer(function(){ me.cmpEl.focus(); }, 50);
|
||||||
|
@ -3908,6 +3955,11 @@ define([
|
||||||
bulletsText: 'Bullets and Numbering',
|
bulletsText: 'Bullets and Numbering',
|
||||||
txtDistribHor : 'Distribute Horizontally',
|
txtDistribHor : 'Distribute Horizontally',
|
||||||
txtDistribVert : 'Distribute Vertically',
|
txtDistribVert : 'Distribute Vertically',
|
||||||
|
textRotate270: 'Rotate Left 90°',
|
||||||
|
textRotate90: 'Rotate Right 90°',
|
||||||
|
textFlipV: 'Flip Vertically',
|
||||||
|
textFlipH: 'Flip Horizontally',
|
||||||
|
textRotate: 'Rotation'
|
||||||
|
|
||||||
}, DE.Views.DocumentHolder || {}));
|
}, DE.Views.DocumentHolder || {}));
|
||||||
});
|
});
|
|
@ -525,8 +525,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'
|
||||||
|
|
||||||
}, DE.Views.ImageSettings || {}));
|
}, DE.Views.ImageSettings || {}));
|
||||||
});
|
});
|
|
@ -1846,7 +1846,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'
|
||||||
}, DE.Views.ShapeSettings || {}));
|
}, DE.Views.ShapeSettings || {}));
|
||||||
});
|
});
|
||||||
|
|
|
@ -1242,6 +1242,11 @@
|
||||||
"DE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
"DE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
||||||
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
||||||
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||||
|
"DE.Views.DocumentHolder.textRotate270": "Rotate Left 90°",
|
||||||
|
"DE.Views.DocumentHolder.textRotate90": "Rotate Right 90°",
|
||||||
|
"DE.Views.DocumentHolder.textFlipV": "Flip Vertically",
|
||||||
|
"DE.Views.DocumentHolder.textFlipH": "Flip Horizontally",
|
||||||
|
"DE.Views.DocumentHolder.textRotate": "Rotation",
|
||||||
"DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel",
|
"DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel",
|
||||||
"DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok",
|
"DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok",
|
||||||
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
||||||
|
|
Loading…
Reference in a new issue