Tabs and tabels scrolling fix (#4069)

Fixes #4037. Credit to @w20k
This commit is contained in:
Denis Denisov 2019-01-22 07:35:27 +02:00 committed by Luke Towers
parent 1caaac9704
commit ec2a0d5fb0
19 changed files with 83 additions and 47 deletions

View File

@ -62,7 +62,7 @@
.sweet-alert button::-moz-focus-inner {border:0}
.sweet-overlay {background-color:rgba(0,0,0,0.2);z-index:10499}
.sweet-alert {text-align:right;border-radius:3px;-webkit-box-shadow:0 27px 24px 0 rgba(0,0,0,0.2),0 40px 77px 0 rgba(0,0,0,0.22);box-shadow:0 27px 24px 0 rgba(0,0,0,0.2),0 40px 77px 0 rgba(0,0,0,0.22);z-index:10500}
.sweet-alert h2 {word-break:word-break;word-wrap:break-word;max-height:350px;overflow-y:auto;margin:10px 0 17px 0;color:#2b3e50;text-align:left;font-size:15px;line-height:23px}
.sweet-alert h2 {word-break:break-word;word-wrap:break-word;max-height:350px;overflow-y:auto;margin:10px 0 17px 0;color:#2b3e50;text-align:left;font-size:15px;line-height:23px}
.sweet-alert p {margin:0}
.sweet-alert p.text-muted {margin-bottom:20px;color:#555}
.control-simplelist {font-size:13px;padding:20px 20px 2px 20px;margin-bottom:20px;background:#fff;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}
@ -435,7 +435,7 @@ body.dragging .control-treeview ol.dragging >li >div .custom-checkbox,
body.dragging .control-treeview ol.dragging ol >li >div .custom-checkbox {-webkit-transition:opacity 0.5s;transition:opacity 0.5s;opacity:0;filter:alpha(opacity=0)}
body.dragging .control-treeview.treeview-light ol.dragging >li >div,
body.dragging .control-treeview.treeview-light ol.dragging ol >li >div {background-color:#f9f9f9}
@media only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-devicepixel-ratio:1.5),only screen and (min-resolution:1.5dppx) {.control-treeview ol >li >div:before {background-position:0 -79px;background-size:21px auto }.control-treeview ol >li.has-subitems >div:before {background-position:0 -52px }.control-treeview ol >li.has-subitems >div:hover:before,.control-treeview ol >li.has-subitems >div.popover-highlight:before {background-position:0 -102px }.control-treeview ol >li.dragged >div:before,.control-treeview ol >li.dragged li >div:before,.control-treeview ol >li >div:hover:before,.control-treeview ol >li >div.popover-highlight:before {background-position:0 -129px }.control-treeview ol >li.dragged li.has-subitems >div:before,.control-treeview ol >li.dragged.has-subitems >div:before {background-position:0 -102px }.control-treeview ol >li.drop-target >div:before {background-position:0 -129px }.control-treeview ol >li.drop-target.has-subitems >div:before {background-position:0 -102px }}
@media only screen and (min--moz-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-devicepixel-ratio:1.5),only screen and (min-resolution:1.5dppx) {.control-treeview ol >li >div:before {background-position:0 -79px;background-size:21px auto }.control-treeview ol >li.has-subitems >div:before {background-position:0 -52px }.control-treeview ol >li.has-subitems >div:hover:before,.control-treeview ol >li.has-subitems >div.popover-highlight:before {background-position:0 -102px }.control-treeview ol >li.dragged >div:before,.control-treeview ol >li.dragged li >div:before,.control-treeview ol >li >div:hover:before,.control-treeview ol >li >div.popover-highlight:before {background-position:0 -129px }.control-treeview ol >li.dragged li.has-subitems >div:before,.control-treeview ol >li.dragged.has-subitems >div:before {background-position:0 -102px }.control-treeview ol >li.drop-target >div:before {background-position:0 -129px }.control-treeview ol >li.drop-target.has-subitems >div:before {background-position:0 -102px }}
.sidenav-tree {width:300px}
.sidenav-tree .control-toolbar {padding:0}
.sidenav-tree .control-toolbar .toolbar-item {display:block}
@ -563,7 +563,7 @@ html.svg .svg-icon-container i.svg-replace {display:none}
@-webkit-keyframes fadeOutUp {0% {opacity:1 }100% {opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0) }}
@keyframes fadeOutUp {0% {opacity:1 }100% {opacity:0;-webkit-transform:translate3d(0,-100%,0);-ms-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0) }}
.fadeOutUp {-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp}
html:not(.mobile) body.drag * {cursor:drag !important;cursor:-webkit-grab !important;cursor:-moz-grab !important}
html:not(.mobile) body.drag * {cursor:grab !important;cursor:-webkit-grab !important;cursor:-moz-grab !important}
body.dragging,
body.dragging * {cursor:move !important}
body.loading,

View File

@ -740,7 +740,7 @@ $.fn.sideNav.noConflict=function(){$.fn.sideNav=old
return this}
$(document).ready(function(){$('[data-control="sidenav"]').sideNav()})}(window.jQuery);+function($){"use strict";var Base=$.oc.foundation.base,BaseProto=Base.prototype
var Scrollbar=function(element,options){var
$el=this.$el=$(element),el=$el.get(0),self=this,options=this.options=options||{},sizeName=this.sizeName=options.vertical?'height':'width',isNative=$('html').hasClass('mobile'),isTouch=this.isTouch=Modernizr.touch,isScrollable=this.isScrollable=false,isLocked=this.isLocked=false,eventElementName=options.vertical?'pageY':'pageX',dragStart=0,startOffset=0;$.oc.foundation.controlUtils.markDisposable(element)
$el=this.$el=$(element),el=$el.get(0),self=this,options=this.options=options||{},sizeName=this.sizeName=options.vertical?'height':'width',isNative=$('html').hasClass('mobile'),isTouch=this.isTouch=Modernizr.touchevents,isScrollable=this.isScrollable=false,isLocked=this.isLocked=false,eventElementName=options.vertical?'pageY':'pageX',dragStart=0,startOffset=0;$.oc.foundation.controlUtils.markDisposable(element)
Base.call(this)
this.$el.one('dispose-control',this.proxy(this.dispose))
if(isNative){return}
@ -954,12 +954,12 @@ this.$fixButton.click(function(){self.fixPanel()
return false})
$('.fix-button-container',this.$el).append(this.$fixButton)
this.$sideNavItems.click(function(){if($(this).data('no-side-panel')){return}
if(Modernizr.touch&&$(window).width()<self.options.breakpoint){if($(this).data('menu-item')==self.visibleItemId&&self.panelVisible){self.hideSidePanel()
if(Modernizr.touchevents&&$(window).width()<self.options.breakpoint){if($(this).data('menu-item')==self.visibleItemId&&self.panelVisible){self.hideSidePanel()
return}
else{self.displaySidePanel()}}
self.displayTab(this)
return false})
if(!Modernizr.touch){self.$sideNav.mouseleave(function(){clearTimeout(self.panelOpenTimeout)})
if(!Modernizr.touchevents){self.$sideNav.mouseleave(function(){clearTimeout(self.panelOpenTimeout)})
self.$el.mouseleave(function(){self.hideSidePanel()})
self.$sideNavItems.mouseenter(function(){if($(window).width()<self.options.breakpoint||!self.panelFixed()){if($(this).data('no-side-panel')){self.hideSidePanel()
return}
@ -989,7 +989,7 @@ SidePanelTab.prototype.hideSidePanel=function(){$(document.body).removeClass('di
if(this.$el.next('#layout-body').length==0){$('#layout-body').before(this.$el)}
this.panelVisible=false
this.updateActiveTab()}
SidePanelTab.prototype.updatePanelPosition=function(){if(!this.panelFixed()||Modernizr.touch){this.$el.height($(document).height()-this.mainNavHeight)}
SidePanelTab.prototype.updatePanelPosition=function(){if(!this.panelFixed()||Modernizr.touchevents){this.$el.height($(document).height()-this.mainNavHeight)}
else{this.$el.css('height','')}
if(this.panelVisible&&$(window).width()>this.options.breakpoint&&this.panelFixed()){this.hideSidePanel()}}
SidePanelTab.prototype.updateActiveTab=function(){if(!this.panelVisible&&($(window).width()<this.options.breakpoint||!this.panelFixed())){$.oc.sideNav.unsetActiveItem()}
@ -1014,7 +1014,7 @@ $.fn.sidePanelTab.Constructor=SidePanelTab
$.fn.sidePanelTab.noConflict=function(){$.fn.sidePanelTab=old
return this}
$(window).on('load',function(){$('[data-control=layout-sidepanel]').sidePanelTab()})
$(document).ready(function(){if(Modernizr.touch||(typeof(localStorage)!=='undefined')){if(localStorage.ocSidePanelFixed==0){$(document.body).addClass('side-panel-not-fixed')
$(document).ready(function(){if(Modernizr.touchevents||(typeof(localStorage)!=='undefined')){if(localStorage.ocSidePanelFixed==0){$(document.body).addClass('side-panel-not-fixed')
$(window).trigger('resize')}
else if(localStorage.ocSidePanelFixed==1){$(document.body).removeClass('side-panel-not-fixed')
$(window).trigger('resize')}}})}(window.jQuery);+function($){"use strict";var SimpleList=function(element,options){var $el=this.$el=$(element)

View File

@ -26,7 +26,7 @@
options = this.options = options || {},
sizeName = this.sizeName = options.vertical ? 'height' : 'width',
isNative = $('html').hasClass('mobile'),
isTouch = this.isTouch = Modernizr.touch,
isTouch = this.isTouch = Modernizr.touchevents,
isScrollable = this.isScrollable = false,
isLocked = this.isLocked = false,
eventElementName = options.vertical ? 'pageY' : 'pageX',

View File

@ -35,7 +35,7 @@
return
}
if (Modernizr.touch && $(window).width() < self.options.breakpoint) {
if (Modernizr.touchevents && $(window).width() < self.options.breakpoint) {
if ($(this).data('menu-item') == self.visibleItemId && self.panelVisible) {
self.hideSidePanel()
return
@ -50,7 +50,7 @@
return false
})
if (!Modernizr.touch) {
if (!Modernizr.touchevents) {
// The side panel now opens only when a menu item is hovered and
// when the item doesn't have the "data-no-side-panel" attribute.
// TODO: remove the comment and the code below if no issues noticed.
@ -151,7 +151,7 @@
}
SidePanelTab.prototype.updatePanelPosition = function() {
if (!this.panelFixed() || Modernizr.touch) {
if (!this.panelFixed() || Modernizr.touchevents) {
this.$el.height($(document).height() - this.mainNavHeight)
}
else {
@ -238,7 +238,7 @@
// ====================
$(document).ready(function() {
if (Modernizr.touch || (typeof(localStorage) !== 'undefined')) {
if (Modernizr.touchevents || (typeof(localStorage) !== 'undefined')) {
if (localStorage.ocSidePanelFixed == 0) {
$(document.body).addClass('side-panel-not-fixed')
$(window).trigger('resize')

View File

@ -14,7 +14,7 @@
z-index: @zindex-alert;
h2 {
word-break: word-break;
word-break: break-word;
word-wrap: break-word;
max-height: 350px;
overflow-y: auto;

View File

@ -577,7 +577,7 @@ body.dragging .control-treeview {
// Retina
//
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-devicepixel-ratio: 1.5), only screen and (min-resolution: 1.5dppx) {
@media only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-devicepixel-ratio: 1.5), only screen and (min-resolution: 1.5dppx) {
.control-treeview {
ol {
> li {

View File

@ -3,7 +3,7 @@
// --------------------------------------------------
html:not(.mobile) body.drag * {
cursor: drag !important;
cursor: grab !important;
cursor: -webkit-grab !important;
cursor: -moz-grab !important;
}

View File

@ -41,7 +41,7 @@
$(window).resize($.proxy(this.updateWidth, this))
this.updateWidth()
if (!Modernizr.touch) {
if (!Modernizr.touchevents) {
this.$el.sortable({
vertical: false,
handle: '.drag-handle',

View File

@ -91,7 +91,7 @@
$clone.data('dragComponents', { x: objX, y: objY })
if (Modernizr.touch) {
if (Modernizr.touchevents) {
$(window).on('touchmove.oc.dragcomponents', function(event){
var touchEvent = event.originalEvent
moveDrag(touchEvent.touches[0])

File diff suppressed because one or more lines are too long

View File

@ -119,7 +119,7 @@
}
ExceptionBeautifier.prototype.initCustomSelect = function (select) {
if (Modernizr.touch) {
if (Modernizr.touchevents) {
return
}

View File

@ -108,7 +108,7 @@
})
}
if (Modernizr.touch) {
if (Modernizr.touchevents) {
$el.on('touchstart.dragScroll', this.options.dragSelector, function(event){
var touchEvent = event.originalEvent
if (touchEvent.touches.length == 1) {
@ -135,7 +135,7 @@
dragStart = event[eventElementName]
startOffset = self.options.vertical ? $el.scrollTop() : $el.scrollLeft()
if (Modernizr.touch) {
if (Modernizr.touchevents) {
$(window).on('touchmove.dragScroll', function(event) {
var touchEvent = event.originalEvent
moveDrag(touchEvent.touches[0])

View File

@ -158,7 +158,7 @@
}
FilterWidget.prototype.focusSearch = function() {
if (Modernizr.touch)
if (Modernizr.touchevents)
return
var $input = $('#controlFilterPopover input.filter-search-input'),

View File

@ -124,7 +124,7 @@
$(select).select2(options)
if (!Modernizr.touch) {
if (!Modernizr.touchevents) {
this.indicatorContainer = $('.select2-container', this.containerCell)
this.indicatorContainer.addClass('loading-indicator-container size-small')
}
@ -133,11 +133,11 @@
DropdownEditor.prototype.createPlaceholder = function(select) {
var placeholder = this.propertyDefinition.placeholder
if (placeholder !== undefined && !Modernizr.touch) {
if (placeholder !== undefined && !Modernizr.touchevents) {
this.createOption(select, null, null)
}
if (placeholder !== undefined && Modernizr.touch) {
if (placeholder !== undefined && Modernizr.touchevents) {
this.createOption(select, placeholder, null)
}
}
@ -382,7 +382,7 @@
}
DropdownEditor.prototype.showLoadingIndicator = function() {
if (!Modernizr.touch) {
if (!Modernizr.touchevents) {
this.indicatorContainer.loadIndicator()
}
}
@ -392,7 +392,7 @@
return
}
if (!Modernizr.touch) {
if (!Modernizr.touchevents) {
this.indicatorContainer.loadIndicator('hide')
this.indicatorContainer.loadIndicator('destroy')
}

View File

@ -22,7 +22,7 @@
$.oc = {}
var CursorLoadIndicator = function () {
if (Modernizr.touch)
if (Modernizr.touchevents)
return
this.counter = 0
@ -31,7 +31,7 @@
}
CursorLoadIndicator.prototype.show = function(event) {
if (Modernizr.touch)
if (Modernizr.touchevents)
return
this.counter++
@ -58,7 +58,7 @@
}
CursorLoadIndicator.prototype.hide = function(force) {
if (Modernizr.touch)
if (Modernizr.touchevents)
return
this.counter--

View File

@ -153,7 +153,7 @@ table.table.data {
}
}
tr.rowlink:hover td, tr:not(.no-data).selected td, {
tr.rowlink:hover td, tr:not(.no-data).selected td {
background: @color-list-hover-bg !important;
color: @highlight-hover-text;
@ -573,6 +573,7 @@ table.table.data {
//
.list-scrollable-container {
touch-action: none;
position: relative;
.horizontal-scroll-indicators(@color-list-text-head);

File diff suppressed because one or more lines are too long

View File

@ -4595,7 +4595,7 @@ table.table.data tr.list-tree-level-10 td.list-cell-index-1 {padding-left:115px}
.report-widget .table-container table.table.data thead tr th {border-top:none !important}
.report-widget .table-container table.table.data tbody tr:nth-child(even) td,
.report-widget .table-container table.table.data tbody tr:nth-child(even) th {background-color:transparent}
.list-scrollable-container {position:relative}
.list-scrollable-container {touch-action:none;position:relative}
.list-scrollable-container:after,
.list-scrollable-container:before {display:none;position:absolute;top:50%;margin-top:-7px;height:9px;font-size:10px;color:#666}
.list-scrollable-container:before {left:-6px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;content:"\f104"}

File diff suppressed because one or more lines are too long