Commit 8633f8e7 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил scroll в PopUpSelector.

Переделал удаление элементов списка для PopUpSelector

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55681 954022d7-b5bf-4e40-9824-e11837661b57
parent 6025ea52
......@@ -21,6 +21,11 @@
<script type="text/javascript" src="menu/js/ui.spinner.min.js"></script>
<script type="text/javascript" src="../Common/3rdparty/XRegExp/xregexp-all.js"></script>
<!-- scroll -->
<script type="text/css" src="menu/perfect-scrollbar/perfect-scrollbar.css"></script>
<script type="text/javascript" src="menu/perfect-scrollbar/jquery.mousewheel.js"></script>
<script type="text/javascript" src="menu/perfect-scrollbar/perfect-scrollbar.js"></script>
<script type="text/javascript">
//<![CDATA[
window.g_debug_mode = false;
......
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
(function($) {
var types = ['DOMMouseScroll', 'mousewheel'];
if ($.event.fixHooks) {
for ( var i=types.length; i; ) {
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
}
}
$.event.special.mousewheel = {
setup: function() {
if ( this.addEventListener ) {
for ( var i=types.length; i; ) {
this.addEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i=types.length; i; ) {
this.removeEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
});
function handler(event) {
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
// Old school scrollwheel delta
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
// Gecko
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaY = 0;
deltaX = -1*delta;
}
// Webkit
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
})(jQuery);
.ps-container .ps-scrollbar-x-rail {
position: absolute; /* please don't change 'position' */
bottom: 3px; /* there must be 'bottom' for ps-scrollbar-x-rail */
height: 8px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
opacity: 0;
filter: alpha(opacity = 0);
-o-transition: background-color .2s linear, opacity .2s linear;
-webkit-transition: background-color .2s linear, opacity .2s linear;
-moz-transition: background-color .2s linear, opacity .2s linear;
transition: background-color .2s linear, opacity .2s linear;
}
.ps-container:hover .ps-scrollbar-x-rail,
.ps-container.hover .ps-scrollbar-x-rail {
opacity: 0.6;
filter: alpha(opacity = 60);
}
.ps-container .ps-scrollbar-x-rail:hover,
.ps-container .ps-scrollbar-x-rail.hover {
background-color: #eee;
opacity: 0.9;
filter: alpha(opacity = 90);
}
.ps-container .ps-scrollbar-x-rail.in-scrolling {
opacity: 0.9;
filter: alpha(opacity = 90);
}
.ps-container .ps-scrollbar-y-rail {
position: absolute; /* please don't change 'position' */
right: 3px; /* there must be 'right' for ps-scrollbar-y-rail */
width: 8px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
opacity: 0;
filter: alpha(opacity = 0);
-o-transition: background-color .2s linear, opacity .2s linear;
-webkit-transition: background-color .2s linear, opacity .2s linear;
-moz-transition: background-color .2s linear, opacity .2s linear;
transition: background-color .2s linear, opacity .2s linear;
}
.ps-container:hover .ps-scrollbar-y-rail,
.ps-container.hover .ps-scrollbar-y-rail {
opacity: 0.6;
filter: alpha(opacity = 60);
}
.ps-container .ps-scrollbar-y-rail:hover,
.ps-container .ps-scrollbar-y-rail.hover {
background-color: #eee;
opacity: 0.9;
filter: alpha(opacity = 90);
}
.ps-container .ps-scrollbar-y-rail.in-scrolling {
opacity: 0.9;
filter: alpha(opacity = 90);
}
.ps-container .ps-scrollbar-x {
position: absolute; /* please don't change 'position' */
bottom: 0; /* there must be 'bottom' for ps-scrollbar-x */
height: 8px;
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-o-transition: background-color .2s linear;
-webkit-transition: background-color.2s linear;
-moz-transition: background-color .2s linear;
transition: background-color .2s linear;
}
.ps-container.ie6 .ps-scrollbar-x {
font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */
}
.ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x,
.ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x {
background-color: #999;
}
.ps-container .ps-scrollbar-y {
position: absolute; /* please don't change 'position' */
right: 0; /* there must be 'right' for ps-scrollbar-y */
width: 8px;
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-o-transition: background-color .2s linear;
-webkit-transition: background-color.2s linear;
-moz-transition: background-color .2s linear;
transition: background-color .2s linear;
}
.ps-container.ie6 .ps-scrollbar-y {
font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */
}
.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y,
.ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y {
background-color: #999;
}
.ps-container.ie .ps-scrollbar-x,
.ps-container.ie .ps-scrollbar-y {
visibility: hidden;
}
.ps-container.ie:hover .ps-scrollbar-x,
.ps-container.ie:hover .ps-scrollbar-y,
.ps-container.ie.hover .ps-scrollbar-x,
.ps-container.ie.hover .ps-scrollbar-y {
visibility: visible;
}
This diff is collapsed.
......@@ -918,3 +918,113 @@ input, textarea {outline:none;}
.ToolbarShapeGroup { background: url("../img/group.png") no-repeat scroll 0 0 transparent; }
.ToolbarShapeUnGroup { background: url("../img/ungroup.png") no-repeat scroll 0 0 transparent; }
.ps-container .ps-scrollbar-x-rail {
position: absolute;
bottom: 3px;
height: 8px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
opacity: 0;
filter: alpha(opacity = 0);
-o-transition: background-color .2s linear, opacity .2s linear;
-webkit-transition: background-color .2s linear, opacity .2s linear;
-moz-transition: background-color .2s linear, opacity .2s linear;
transition: background-color .2s linear, opacity .2s linear;
}
.ps-container .ps-scrollbar-x {
position: absolute;
bottom: 0;
height: 8px;
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-o-transition: background-color .2s linear;
-webkit-transition: background-color.2s linear;
-moz-transition: background-color .2s linear;
transition: background-color .2s linear;
}
.dropdown-menu.ps-container .ps-scrollbar-y-rail {
margin-top: 5px;
}
.ps-container .ps-scrollbar-y-rail {
position: absolute;
right: 3px;
width: 8px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
opacity: 0;
filter: alpha(opacity = 0);
-o-transition: background-color .2s linear, opacity .2s linear;
-webkit-transition: background-color .2s linear, opacity .2s linear;
-moz-transition: background-color .2s linear, opacity .2s linear;
transition: background-color .2s linear, opacity .2s linear;
}
.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y, .ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y {
background-color: #999;
}
.ps-container .ps-scrollbar-y {
position: absolute;
right: 0;
width: 8px;
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-o-transition: background-color .2s linear;
-webkit-transition: background-color.2s linear;
-moz-transition: background-color .2s linear;
transition: background-color .2s linear;
}
.ps-scrollbar-x-rail, .ps-scrollbar-y-rail {
z-index: 1;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 11px;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.dropdown-menu.ps-container {
overflow: hidden;
}
.combobox li.selected {
background-color: #7d858c;
}
.combobox li.selected a {
color: #ffffff;
}
.dropdown-menu li > a {
padding: 5px 20px;
cursor: pointer;
}
.dropdown-menu > li > a, #file-menu-panel .panel-menu li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #444444;
white-space: nowrap;
}
\ No newline at end of file
......@@ -21,6 +21,8 @@
this.selector = null;
this.selectorStyle = null;
this.selectorList = null;
this.selectorListEl = [];
this.selectorListJQ = null;
this.selectElement = null;
this.firstElement = null;
......@@ -39,9 +41,9 @@
PopUpSelector.prototype._init = function () {
var t = this;
if (null != this.element) {
this.selector = document.createElement("div");
this.selector = document.createElement('div');
this.selectorStyle = this.selector.style;
this.selector.id = "apiPopUpSelector";
this.selector.id = 'apiPopUpSelector';
this.selector.innerHTML = '<div style="max-height:210px;" class="combobox"><ul id="apiPopUpList" class="dropdown-menu"></ul></div>';
this.element.appendChild(this.selector);
......@@ -65,6 +67,10 @@
t.hide();
}, false);
}
// Для того, чтобы работал scroll
this.selectorListJQ = $('#apiPopUpList');
this.selectorListJQ.perfectScrollbar();
}
};
PopUpSelector.prototype.show = function (isFormula, arrItems, cellRect) {
......@@ -106,6 +112,7 @@
}
this.selectorList.appendChild(item);
this.selectorListEl.push(item);
}
// Selection hack
......@@ -119,6 +126,10 @@
}
}*/
// TODO: В Mozilla избавиться от селекта текста при dblclick
// Для того, чтобы работал scroll
this.selectorListJQ.perfectScrollbar("update");
};
PopUpSelector.prototype.hide = function () {
if (this.isVisible) {
......@@ -136,7 +147,10 @@
return this.isVisible;
};
PopUpSelector.prototype._clearList = function () {
this.selectorList.innerHTML = "";
var elem;
while(elem = this.selectorListEl.pop())
this.selectorList.removeChild(elem);
this.selectElement = null;
this.firstElement = null;
this.isFormula = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment