commit
146eb6741d
|
@ -127,6 +127,9 @@ label {
|
||||||
|
|
||||||
.panel-menu {
|
.panel-menu {
|
||||||
width: 260px;
|
width: 260px;
|
||||||
|
max-height: 100%;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
float: left;
|
float: left;
|
||||||
border-right: @scaled-one-px-value-ie solid @border-toolbar-ie;
|
border-right: @scaled-one-px-value-ie solid @border-toolbar-ie;
|
||||||
border-right: @scaled-one-px-value solid @border-toolbar;
|
border-right: @scaled-one-px-value solid @border-toolbar;
|
||||||
|
|
|
@ -235,6 +235,17 @@ define([
|
||||||
this.rendered = true;
|
this.rendered = true;
|
||||||
this.$el.html($markup);
|
this.$el.html($markup);
|
||||||
this.$el.find('.content-box').hide();
|
this.$el.find('.content-box').hide();
|
||||||
|
if (_.isUndefined(this.scroller)) {
|
||||||
|
var me = this;
|
||||||
|
this.scroller = new Common.UI.Scroller({
|
||||||
|
el: this.$el.find('.panel-menu'),
|
||||||
|
suppressScrollX: true,
|
||||||
|
alwaysVisibleY: true
|
||||||
|
});
|
||||||
|
Common.NotificationCenter.on('window:resize', function() {
|
||||||
|
me.scroller.update();
|
||||||
|
});
|
||||||
|
}
|
||||||
this.applyMode();
|
this.applyMode();
|
||||||
|
|
||||||
if ( !!this.api ) {
|
if ( !!this.api ) {
|
||||||
|
@ -257,6 +268,7 @@ define([
|
||||||
if (!panel)
|
if (!panel)
|
||||||
panel = this.active || defPanel;
|
panel = this.active || defPanel;
|
||||||
this.$el.show();
|
this.$el.show();
|
||||||
|
this.scroller.update();
|
||||||
this.selectMenu(panel, opts, defPanel);
|
this.selectMenu(panel, opts, defPanel);
|
||||||
this.api.asc_enableKeyEvents(false);
|
this.api.asc_enableKeyEvents(false);
|
||||||
|
|
||||||
|
@ -400,6 +412,17 @@ define([
|
||||||
this.$el.find('.content-box:visible').hide();
|
this.$el.find('.content-box:visible').hide();
|
||||||
panel.show(opts);
|
panel.show(opts);
|
||||||
|
|
||||||
|
if (this.scroller) {
|
||||||
|
var itemTop = item.$el.position().top,
|
||||||
|
itemHeight = item.$el.outerHeight(),
|
||||||
|
listHeight = this.$el.outerHeight();
|
||||||
|
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||||
|
var height = this.scroller.$el.scrollTop() + itemTop + (itemHeight - listHeight)/2;
|
||||||
|
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||||
|
this.scroller.scrollTop(height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.active = menu;
|
this.active = menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,6 +231,17 @@ define([
|
||||||
this.rendered = true;
|
this.rendered = true;
|
||||||
this.$el.html($markup);
|
this.$el.html($markup);
|
||||||
this.$el.find('.content-box').hide();
|
this.$el.find('.content-box').hide();
|
||||||
|
if (_.isUndefined(this.scroller)) {
|
||||||
|
var me = this;
|
||||||
|
this.scroller = new Common.UI.Scroller({
|
||||||
|
el: this.$el.find('.panel-menu'),
|
||||||
|
suppressScrollX: true,
|
||||||
|
alwaysVisibleY: true
|
||||||
|
});
|
||||||
|
Common.NotificationCenter.on('window:resize', function() {
|
||||||
|
me.scroller.update();
|
||||||
|
});
|
||||||
|
}
|
||||||
this.applyMode();
|
this.applyMode();
|
||||||
|
|
||||||
if ( !!this.api ) {
|
if ( !!this.api ) {
|
||||||
|
@ -253,6 +264,7 @@ define([
|
||||||
if (!panel)
|
if (!panel)
|
||||||
panel = this.active || defPanel;
|
panel = this.active || defPanel;
|
||||||
this.$el.show();
|
this.$el.show();
|
||||||
|
this.scroller.update();
|
||||||
this.selectMenu(panel, defPanel);
|
this.selectMenu(panel, defPanel);
|
||||||
|
|
||||||
this.api && this.api.asc_enableKeyEvents(false);
|
this.api && this.api.asc_enableKeyEvents(false);
|
||||||
|
@ -393,6 +405,17 @@ define([
|
||||||
this.$el.find('.content-box:visible').hide();
|
this.$el.find('.content-box:visible').hide();
|
||||||
panel.show();
|
panel.show();
|
||||||
|
|
||||||
|
if (this.scroller) {
|
||||||
|
var itemTop = item.$el.position().top,
|
||||||
|
itemHeight = item.$el.outerHeight(),
|
||||||
|
listHeight = this.$el.outerHeight();
|
||||||
|
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||||
|
var height = this.scroller.$el.scrollTop() + itemTop + (itemHeight - listHeight)/2;
|
||||||
|
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||||
|
this.scroller.scrollTop(height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.active = menu;
|
this.active = menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,6 +212,17 @@ define([
|
||||||
this.rendered = true;
|
this.rendered = true;
|
||||||
this.$el.html($markup);
|
this.$el.html($markup);
|
||||||
this.$el.find('.content-box').hide();
|
this.$el.find('.content-box').hide();
|
||||||
|
if (_.isUndefined(this.scroller)) {
|
||||||
|
var me = this;
|
||||||
|
this.scroller = new Common.UI.Scroller({
|
||||||
|
el: this.$el.find('.panel-menu'),
|
||||||
|
suppressScrollX: true,
|
||||||
|
alwaysVisibleY: true
|
||||||
|
});
|
||||||
|
Common.NotificationCenter.on('window:resize', function() {
|
||||||
|
me.scroller.update();
|
||||||
|
});
|
||||||
|
}
|
||||||
this.applyMode();
|
this.applyMode();
|
||||||
|
|
||||||
if ( !!this.api ) {
|
if ( !!this.api ) {
|
||||||
|
@ -235,6 +246,7 @@ define([
|
||||||
if (!panel)
|
if (!panel)
|
||||||
panel = this.active || defPanel;
|
panel = this.active || defPanel;
|
||||||
this.$el.show();
|
this.$el.show();
|
||||||
|
this.scroller.update();
|
||||||
this.selectMenu(panel, defPanel);
|
this.selectMenu(panel, defPanel);
|
||||||
|
|
||||||
this.api.asc_enableKeyEvents(false);
|
this.api.asc_enableKeyEvents(false);
|
||||||
|
@ -377,6 +389,17 @@ define([
|
||||||
this.$el.find('.content-box:visible').hide();
|
this.$el.find('.content-box:visible').hide();
|
||||||
panel.show();
|
panel.show();
|
||||||
|
|
||||||
|
if (this.scroller) {
|
||||||
|
var itemTop = item.$el.position().top,
|
||||||
|
itemHeight = item.$el.outerHeight(),
|
||||||
|
listHeight = this.$el.outerHeight();
|
||||||
|
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||||
|
var height = this.scroller.$el.scrollTop() + itemTop + (itemHeight - listHeight)/2;
|
||||||
|
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||||
|
this.scroller.scrollTop(height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.active = menu;
|
this.active = menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue