|
@@ -33,15 +33,17 @@
|
|
|
|
|
|
|
|
function initWhenReady(el) {
|
|
function initWhenReady(el) {
|
|
|
if ($(el).parents('.dataTables_wrapper').length > 0) {
|
|
if ($(el).parents('.dataTables_wrapper').length > 0) {
|
|
|
- var scrollingRatio = function () {
|
|
|
|
|
- return $(el).parents('.dataTables_wrapper').width() - $(el).parents('.dataTables_wrapper').find('hue-scrollbar-x').width()
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ var colWidth = $(el).parents('.dataTables_wrapper').find('.jHueTableExtenderClonedContainerColumn').width() + 5;
|
|
|
if ($(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x-rail').length == 0 && $(el).parents('.dataTables_wrapper').width() < $(el).parents('.dataTables_wrapper')[0].scrollWidth) {
|
|
if ($(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x-rail').length == 0 && $(el).parents('.dataTables_wrapper').width() < $(el).parents('.dataTables_wrapper')[0].scrollWidth) {
|
|
|
- var colWidth = $(el).parents('.dataTables_wrapper').find('.jHueTableExtenderClonedContainerColumn').width() + 5;
|
|
|
|
|
|
|
+ $('.hue-scrollbar-x-rail').remove();
|
|
|
var scrollbarRail = $('<div>');
|
|
var scrollbarRail = $('<div>');
|
|
|
var scrollbar = $('<div>').addClass('hue-scrollbar-x');
|
|
var scrollbar = $('<div>').addClass('hue-scrollbar-x');
|
|
|
scrollbar.width(Math.max(20, $(el).parents('.dataTables_wrapper').width() * ($(el).parents('.dataTables_wrapper').width() / $(el).parents('.dataTables_wrapper')[0].scrollWidth)));
|
|
scrollbar.width(Math.max(20, $(el).parents('.dataTables_wrapper').width() * ($(el).parents('.dataTables_wrapper').width() / $(el).parents('.dataTables_wrapper')[0].scrollWidth)));
|
|
|
scrollbar.appendTo(scrollbarRail);
|
|
scrollbar.appendTo(scrollbarRail);
|
|
|
|
|
+ try {
|
|
|
|
|
+ scrollbar.draggable('destroy');
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (e) {}
|
|
|
scrollbar.draggable({
|
|
scrollbar.draggable({
|
|
|
axis: 'x',
|
|
axis: 'x',
|
|
|
containment: 'parent',
|
|
containment: 'parent',
|
|
@@ -68,11 +70,12 @@
|
|
|
scrollbar.css("left", ((scrollbarRail.width() - scrollbar.width()) * ($(el).parents('.dataTables_wrapper').scrollLeft() / ($(el).parents('.dataTables_wrapper')[0].scrollWidth - $(el).parents('.dataTables_wrapper').width()))) + "px");
|
|
scrollbar.css("left", ((scrollbarRail.width() - scrollbar.width()) * ($(el).parents('.dataTables_wrapper').scrollLeft() / ($(el).parents('.dataTables_wrapper')[0].scrollWidth - $(el).parents('.dataTables_wrapper').width()))) + "px");
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- var colWidth = $(el).parents('.dataTables_wrapper').find('.jHueTableExtenderClonedContainerColumn').width() + 5;
|
|
|
|
|
$(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x-rail').width($(el).parents(".dataTables_wrapper").width() - colWidth);
|
|
$(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x-rail').width($(el).parents(".dataTables_wrapper").width() - colWidth);
|
|
|
- var scrollbarRail = $(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x-rail');
|
|
|
|
|
var scrollbar = $(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x');
|
|
var scrollbar = $(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x');
|
|
|
scrollbar.width(Math.max(20, $(el).parents('.dataTables_wrapper').width() * ($(el).parents('.dataTables_wrapper').width() / $(el).parents('.dataTables_wrapper')[0].scrollWidth)));
|
|
scrollbar.width(Math.max(20, $(el).parents('.dataTables_wrapper').width() * ($(el).parents('.dataTables_wrapper').width() / $(el).parents('.dataTables_wrapper')[0].scrollWidth)));
|
|
|
|
|
+
|
|
|
|
|
+ var scrollbarRail = $(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x-rail');
|
|
|
|
|
+ scrollbarRail.width($(el).parents(".dataTables_wrapper").width() - colWidth);
|
|
|
scrollbar.css("left", ((scrollbarRail.width() - scrollbar.width()) * ($(el).parents('.dataTables_wrapper').scrollLeft() / ($(el).parents('.dataTables_wrapper')[0].scrollWidth - $(el).parents('.dataTables_wrapper').width()))) + "px");
|
|
scrollbar.css("left", ((scrollbarRail.width() - scrollbar.width()) * ($(el).parents('.dataTables_wrapper').scrollLeft() / ($(el).parents('.dataTables_wrapper')[0].scrollWidth - $(el).parents('.dataTables_wrapper').width()))) + "px");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -82,7 +85,7 @@
|
|
|
var el = this.element;
|
|
var el = this.element;
|
|
|
|
|
|
|
|
var checkWidth = function () {
|
|
var checkWidth = function () {
|
|
|
- if ($(el).parents('.dataTables_wrapper').width() > 0) {
|
|
|
|
|
|
|
+ if ($(el).parents('.dataTables_wrapper').find('.jHueTableExtenderClonedContainerColumn').width() > 0) {
|
|
|
initWhenReady(el);
|
|
initWhenReady(el);
|
|
|
} else {
|
|
} else {
|
|
|
window.setTimeout(checkWidth, 100);
|
|
window.setTimeout(checkWidth, 100);
|