[DE][PE][SSE] Add scroll to context menu
This commit is contained in:
parent
9ee95bab6e
commit
cc2b1309b7
|
@ -651,7 +651,28 @@ define([
|
||||||
if (left < 0)
|
if (left < 0)
|
||||||
left = 0;
|
left = 0;
|
||||||
|
|
||||||
if (this.options.restoreHeight) {
|
if (this.options.restoreHeightAndTop) { // can change top position, if top<0 - then change menu height
|
||||||
|
var cg = Common.Utils.croppedGeometry();
|
||||||
|
docH = cg.height - 10;
|
||||||
|
menuRoot.css('max-height', 'none');
|
||||||
|
menuH = menuRoot.outerHeight();
|
||||||
|
if (top + menuH > docH + cg.top) {
|
||||||
|
top = docH - menuH;
|
||||||
|
}
|
||||||
|
if (top < cg.top)
|
||||||
|
top = cg.top;
|
||||||
|
if (top + menuH > docH + cg.top) {
|
||||||
|
menuRoot.css('max-height', (docH - top) + 'px');
|
||||||
|
(!this.scroller) && (this.scroller = new Common.UI.Scroller({
|
||||||
|
el: this.$el.find('.dropdown-menu '),
|
||||||
|
minScrollbarLength: 30,
|
||||||
|
suppressScrollX: true,
|
||||||
|
alwaysVisibleY: this.scrollAlwaysVisible
|
||||||
|
}));
|
||||||
|
this.wheelSpeed = undefined;
|
||||||
|
}
|
||||||
|
this.scroller && this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
|
} else if (this.options.restoreHeight) {
|
||||||
if (typeof (this.options.restoreHeight) == "number") {
|
if (typeof (this.options.restoreHeight) == "number") {
|
||||||
if (top + menuH > docH) {
|
if (top + menuH > docH) {
|
||||||
menuRoot.css('max-height', (docH - top) + 'px');
|
menuRoot.css('max-height', (docH - top) + 'px');
|
||||||
|
|
|
@ -2671,6 +2671,7 @@ define([
|
||||||
|
|
||||||
this.pictureMenu = new Common.UI.Menu({
|
this.pictureMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
restoreHeightAndTop: true,
|
||||||
initMenu: function(value){
|
initMenu: function(value){
|
||||||
if (_.isUndefined(value.imgProps))
|
if (_.isUndefined(value.imgProps))
|
||||||
return;
|
return;
|
||||||
|
@ -3283,7 +3284,7 @@ define([
|
||||||
|
|
||||||
this.tableMenu = new Common.UI.Menu({
|
this.tableMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
// maxHeight: 610,
|
restoreHeightAndTop: true,
|
||||||
initMenu: function(value){
|
initMenu: function(value){
|
||||||
// table properties
|
// table properties
|
||||||
if (_.isUndefined(value.tableProps))
|
if (_.isUndefined(value.tableProps))
|
||||||
|
@ -4004,6 +4005,7 @@ define([
|
||||||
|
|
||||||
this.textMenu = new Common.UI.Menu({
|
this.textMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
restoreHeightAndTop: true,
|
||||||
initMenu: function(value){
|
initMenu: function(value){
|
||||||
var isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties()));
|
var isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties()));
|
||||||
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties()));
|
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties()));
|
||||||
|
|
|
@ -2056,6 +2056,7 @@ define([
|
||||||
|
|
||||||
me.slideMenu = new Common.UI.Menu({
|
me.slideMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
restoreHeightAndTop: true,
|
||||||
initMenu: function(value) {
|
initMenu: function(value) {
|
||||||
var selectedLast = me.api.asc_IsLastSlideSelected(),
|
var selectedLast = me.api.asc_IsLastSlideSelected(),
|
||||||
selectedFirst = me.api.asc_IsFirstSlideSelected();
|
selectedFirst = me.api.asc_IsFirstSlideSelected();
|
||||||
|
@ -3342,6 +3343,7 @@ define([
|
||||||
|
|
||||||
me.tableMenu = new Common.UI.Menu({
|
me.tableMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
restoreHeightAndTop: true,
|
||||||
initMenu: function(value){
|
initMenu: function(value){
|
||||||
// table properties
|
// table properties
|
||||||
if (_.isUndefined(value.tableProps))
|
if (_.isUndefined(value.tableProps))
|
||||||
|
@ -3555,6 +3557,7 @@ define([
|
||||||
|
|
||||||
me.pictureMenu = new Common.UI.Menu({
|
me.pictureMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
restoreHeightAndTop: true,
|
||||||
initMenu: function(value){
|
initMenu: function(value){
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
mnuUnGroupImg.setDisabled(!me.api.canUnGroup());
|
mnuUnGroupImg.setDisabled(!me.api.canUnGroup());
|
||||||
|
|
|
@ -552,6 +552,7 @@ define([
|
||||||
|
|
||||||
me.ssMenu = new Common.UI.Menu({
|
me.ssMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
restoreHeightAndTop: true,
|
||||||
id : 'id-context-menu-cell',
|
id : 'id-context-menu-cell',
|
||||||
items : [
|
items : [
|
||||||
me.pmiCut,
|
me.pmiCut,
|
||||||
|
@ -831,6 +832,7 @@ define([
|
||||||
|
|
||||||
this.imgMenu = new Common.UI.Menu({
|
this.imgMenu = new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
|
restoreHeightAndTop: true,
|
||||||
items: [
|
items: [
|
||||||
me.pmiImgCut,
|
me.pmiImgCut,
|
||||||
me.pmiImgCopy,
|
me.pmiImgCopy,
|
||||||
|
|
Loading…
Reference in a new issue