mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
Merge pull request 'fix/bug-59516' (#316) from fix/bug-59516 into develop
This commit is contained in:
@ -106,20 +106,22 @@ define([
|
||||
dataHintDirection: '',
|
||||
dataHintOffset: '',
|
||||
dataHintTitle: '',
|
||||
scaling: true
|
||||
scaling: true,
|
||||
header : ''
|
||||
},
|
||||
|
||||
tagName : 'li',
|
||||
|
||||
template: _.template([
|
||||
'<a id="<%= id %>" class="menu-item" <% if (_.isEmpty(iconCls)) { %> data-no-icon <% } %> style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; if(!_.isUndefined(options.dataHint)) { %> data-hint="<%= options.dataHint %>" <% }; if(!_.isUndefined(options.dataHintDirection)) { %> data-hint-direction="<%= options.dataHintDirection %>" <% }; if(!_.isUndefined(options.dataHintOffset)) { %> data-hint-offset="<%= options.dataHintOffset %>" <% }; if(options.dataHintTitle) { %> data-hint-title="<%= options.dataHintTitle %>" <% }; %> >',
|
||||
'<% if (header) { %> <span class="menu-item-header"><%- header %></span> <% } %> <% if (caption) { %> <a id="<%= id %>" class="menu-item" <% if (_.isEmpty(iconCls)) { %> data-no-icon <% } %> style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; if(!_.isUndefined(options.dataHint)) { %> data-hint="<%= options.dataHint %>" <% }; if(!_.isUndefined(options.dataHintDirection)) { %> data-hint-direction="<%= options.dataHintDirection %>" <% }; if(!_.isUndefined(options.dataHintOffset)) { %> data-hint-offset="<%= options.dataHintOffset %>" <% }; if(options.dataHintTitle) { %> data-hint-title="<%= options.dataHintTitle %>" <% }; %> >',
|
||||
'<% if (!_.isEmpty(iconCls)) { %>',
|
||||
'<span class="menu-item-icon <%= iconCls %>"></span>',
|
||||
'<% } else if (!_.isEmpty(iconImg)) { %>',
|
||||
'<img src="<%= iconImg %>" class="menu-item-icon">',
|
||||
'<% } %>',
|
||||
'<%- caption %>',
|
||||
'</a>'
|
||||
'</a>',
|
||||
'<% } %>'
|
||||
].join('')),
|
||||
|
||||
initialize : function(options) {
|
||||
@ -144,6 +146,7 @@ define([
|
||||
this.iconImg = me.options.iconImg;
|
||||
this.hint = me.options.hint;
|
||||
this.rendered = false;
|
||||
this.header = me.options.header;
|
||||
|
||||
if (this.menu !== null && !(this.menu instanceof Common.UI.Menu) && !(this.menu instanceof Common.UI.MenuSimple)) {
|
||||
this.menu = new Common.UI.Menu(_.extend({}, me.options.menu));
|
||||
@ -173,7 +176,8 @@ define([
|
||||
iconCls : me.iconCls,
|
||||
iconImg : me.iconImg,
|
||||
style : me.style,
|
||||
options : me.options
|
||||
options : me.options,
|
||||
header : me.header
|
||||
}));
|
||||
|
||||
if (me.menu) {
|
||||
|
||||
@ -1146,6 +1146,11 @@ section .field-styles {
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.menu-header {
|
||||
font-weight: bold;
|
||||
cursor: default;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.background-plugins {
|
||||
|
||||
@ -3308,12 +3308,12 @@ define([], function () {
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaWithoutBorders] = [me.txtPasteBorders, 0];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaColumnWidth] = [me.txtPasteColWidths, 0];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.mergeConditionalFormating] = [me.txtPasteMerge, 0];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.transpose] = [me.txtPasteTranspose, 0];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyValues] = [me.txtPasteValues, 1];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueNumberFormat] = [me.txtPasteValNumFormat, 1];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueAllFormating] = [me.txtPasteValFormat, 1];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormating] = [me.txtPasteFormat, 2];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.link] = [me.txtPasteLink, 2];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.transpose] = [me.txtPasteTranspose, 2];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = [me.txtPastePicture, 2];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.linkedPicture] = [me.txtPasteLinkPicture, 2];
|
||||
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = [me.txtPasteSourceFormat, 2];
|
||||
@ -3345,37 +3345,48 @@ define([], function () {
|
||||
groups[i] = [];
|
||||
}
|
||||
|
||||
var importText;
|
||||
var importText, pasteItem;
|
||||
|
||||
_.each(pasteItems, function(menuItem, index) {
|
||||
if (menuItem == Asc.c_oSpecialPasteProps.useTextImport) {
|
||||
importText = new Common.UI.MenuItem({
|
||||
caption: me._arrSpecialPaste[menuItem][0] + (me.hkSpecPaste[menuItem] ? ' (' + me.hkSpecPaste[menuItem] + ')' : ''),
|
||||
value: menuItem,
|
||||
checkable: true,
|
||||
toggleGroup : 'specialPasteGroup'
|
||||
}).on('click', _.bind(me.onSpecialPasteItemClick, me));
|
||||
me._arrSpecialPaste[menuItem][2] = importText;
|
||||
} else if (me._arrSpecialPaste[menuItem]) {
|
||||
if (me._arrSpecialPaste[menuItem]) {
|
||||
var mnu = new Common.UI.MenuItem({
|
||||
caption: me._arrSpecialPaste[menuItem][0] + (me.hkSpecPaste[menuItem] ? ' (' + me.hkSpecPaste[menuItem] + ')' : ''),
|
||||
value: menuItem,
|
||||
checkable: true,
|
||||
toggleGroup : 'specialPasteGroup'
|
||||
toggleGroup: 'specialPasteGroup'
|
||||
}).on('click', _.bind(me.onSpecialPasteItemClick, me));
|
||||
groups[me._arrSpecialPaste[menuItem][1]].push(mnu);
|
||||
|
||||
if (menuItem == Asc.c_oSpecialPasteProps.paste) {
|
||||
pasteItem = mnu;
|
||||
} else if (menuItem == Asc.c_oSpecialPasteProps.useTextImport) {
|
||||
importText = mnu;
|
||||
} else {
|
||||
groups[me._arrSpecialPaste[menuItem][1]].push(mnu);
|
||||
}
|
||||
|
||||
me._arrSpecialPaste[menuItem][2] = mnu;
|
||||
}
|
||||
});
|
||||
var newgroup = false;
|
||||
var groupTitles = [me.txtFormula, me.txtValue, me.txtOther];
|
||||
|
||||
if (pasteItem) {
|
||||
menu.addItem(pasteItem);
|
||||
}
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
if (newgroup && groups[i].length>0) {
|
||||
menu.addItem(new Common.UI.MenuItem({ caption: '--' }));
|
||||
newgroup = false;
|
||||
if (groups[i].length > 0) {
|
||||
if (menu.items.length > 0) {
|
||||
menu.addItem(new Common.UI.MenuItem({ caption: '--' }));
|
||||
}
|
||||
menu.addItem(new Common.UI.MenuItem({
|
||||
header: groupTitles[i],
|
||||
disabled: true,
|
||||
cls: 'menu-header'
|
||||
}));
|
||||
_.each(groups[i], function (menuItem, index) {
|
||||
menu.addItem(menuItem);
|
||||
});
|
||||
}
|
||||
_.each(groups[i], function(menuItem, index) {
|
||||
menu.addItem(menuItem);
|
||||
newgroup = true;
|
||||
});
|
||||
}
|
||||
(menu.items.length>0) && menu.items[0].setChecked(true, true);
|
||||
me._state.lastSpecPasteChecked = (menu.items.length>0) ? menu.items[0] : null;
|
||||
|
||||
@ -962,6 +962,9 @@
|
||||
"SSE.Controllers.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
|
||||
"SSE.Controllers.DocumentHolder.txtWidth": "Width",
|
||||
"SSE.Controllers.DocumentHolder.warnFilterError": "You need at least one field in the Values area in order to apply a value filter.",
|
||||
"SSE.Controllers.DocumentHolder.txtFormula": "Formula",
|
||||
"SSE.Controllers.DocumentHolder.txtValue": "Value",
|
||||
"SSE.Controllers.DocumentHolder.txtOther": "Other",
|
||||
"SSE.Controllers.FormulaDialog.sCategoryAll": "All",
|
||||
"SSE.Controllers.FormulaDialog.sCategoryCube": "Cube",
|
||||
"SSE.Controllers.FormulaDialog.sCategoryCustom": "Custom",
|
||||
|
||||
Reference in New Issue
Block a user