CC-1986: Configurable columns for media search

Modified dataTables.ColVis.js plugin to make it work...
This commit is contained in:
Yuchen Wang 2012-01-07 11:55:55 -05:00
parent 6597f6701a
commit f025dccc4f
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,37 @@
Before you overwrite dataTables.ColVis.js, note that we have changed a few lines
in this file.
Running a diff between the original dataTables.ColVis.js and our modified one:
@@ -556,7 +556,11 @@ ColVis.prototype = {
nSpan.innerHTML = text;
$(nButton).bind( sEvent, function (e) {
- that._fnCollectionShow();
+ if ($(".ColVis_collectionBackground").length == 0) {
+ that._fnCollectionShow();
+ } else {
+ that._fnCollectionHide();
+ }
e.preventDefault();
} );
@@ -661,6 +665,7 @@ ColVis.prototype = {
nHidden.style.top = iDivY+"px";
nHidden.style.left = iDivX+"px";
nHidden.style.display = "block";
+ nHidden.style.zIndex = "999";
$(nHidden).css('opacity',0);
var iWinHeight = $(window).height(), iDocHeight = $(document).height(),
@@ -668,6 +673,7 @@ ColVis.prototype = {
nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
nBackground.style.width = ((iWinWidth<iDocWidth)? iWinWidth : iDocWidth) +"px";
+ nBackground.style.zIndex = "998";
var oStyle = this.dom.catcher.style;
oStyle.height = $(this.dom.button).outerHeight()+"px";
Please make this change before updating!!!

View File

@ -556,7 +556,11 @@ ColVis.prototype = {
nSpan.innerHTML = text;
$(nButton).bind( sEvent, function (e) {
that._fnCollectionShow();
if ($(".ColVis_collectionBackground").length == 0) {
that._fnCollectionShow();
} else {
that._fnCollectionHide();
}
e.preventDefault();
} );
@ -661,6 +665,7 @@ ColVis.prototype = {
nHidden.style.top = iDivY+"px";
nHidden.style.left = iDivX+"px";
nHidden.style.display = "block";
nHidden.style.zIndex = "999";
$(nHidden).css('opacity',0);
var iWinHeight = $(window).height(), iDocHeight = $(document).height(),
@ -668,6 +673,7 @@ ColVis.prototype = {
nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
nBackground.style.width = ((iWinWidth<iDocWidth)? iWinWidth : iDocWidth) +"px";
nBackground.style.zIndex = "998";
var oStyle = this.dom.catcher.style;
oStyle.height = $(this.dom.button).outerHeight()+"px";