From e16b77c0a5198b0f79175018e77909037826ae22 Mon Sep 17 00:00:00 2001 From: Aris Feryanto Date: Mon, 6 Jun 2011 16:03:08 +0700 Subject: [PATCH] Add different column pointer for vertical display --- js/makegrid.js | 12 ++++++------ themes/original/css/theme_right.css.php | 13 +++++++++++-- themes/original/img/col_pointer_ver.png | Bin 0 -> 223 bytes themes/pmahomme/css/theme_right.css.php | 11 ++++++++++- themes/pmahomme/img/col_pointer.png | Bin 216 -> 231 bytes themes/pmahomme/img/col_pointer_ver.png | Bin 0 -> 233 bytes 6 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 themes/original/img/col_pointer_ver.png create mode 100644 themes/pmahomme/img/col_pointer_ver.png diff --git a/js/makegrid.js b/js/makegrid.js index be1c96f173..6abbe6eabf 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -103,8 +103,8 @@ .show(); } else { // vertical alignment var newtop = newn < this.colMov.n ? - colPos.top - 20 : // 20 here is from col_pointer.png image height - colPos.top + $(hoveredCol).outerHeight() - 20; + colPos.top : + colPos.top + $(hoveredCol).outerHeight(); $(this.cPointer) .css('top', newtop) .show(); @@ -262,21 +262,21 @@ g.cCpy = document.createElement('div'); // column copy, to store copy of dragged column header g.cPointer = document.createElement('div'); // column pointer, used when reordering column + // assign the table alignment + g.alignment = $("#top_direction_dropdown").val(); + // adjust g.cCpy g.cCpy.className = 'cCpy'; $(g.cCpy).hide(); // adjust g.cPoint - g.cPointer.className = 'cPointer'; + g.cPointer.className = g.alignment != 'vertical' ? 'cPointer' : 'cPointerVer'; $(g.cPointer).hide(); // chain table and grid together t.grid = g; g.t = t; - // assign the table alignment - g.alignment = $("#top_direction_dropdown").val(); - // get first row data columns var $firstRowCols = g.alignment != 'vertical' ? $(t).find('th.draggable') : diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 5493b2a0a7..9805ca219a 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1895,7 +1895,7 @@ span.mysql-number { } .cCpy { - background: #333; + background: #000; color: #FFF; margin: 0.1em; padding: 0.3em; @@ -1908,8 +1908,17 @@ span.mysql-number { .cPointer { background: url(getImgPath(); ?>col_pointer.png); - height: 20px; /* if the height changed, also change makegrid.js */ + height: 20px; margin-left: -5px; /* must be minus half of its width */ position: absolute; width: 10px; } + +.cPointerVer { /* cPointer with vertical display mode */ + background: url(getImgPath(); ?>col_pointer_ver.png); + height: 10px; + margin-left: -5px; + margin-top: -5px; /* must be minus half of its height */ + position: absolute; + width: 20px; +} diff --git a/themes/original/img/col_pointer_ver.png b/themes/original/img/col_pointer_ver.png new file mode 100644 index 0000000000000000000000000000000000000000..1b78158933724dea55dc3bdb44c585ad62d6de78 GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W=!3HF^gw{O+QjEnx?oJHr&dIz4a@dl*-CY>Y zg5Z=C9d4iqXMsm#F#`j)FbFd;%$g$s6l5>)^mS#w&Bn&bAj5jC`vXu&vcxr_#5q4V zH#M(>!MP|ku_QG`p**uBL&4qCHz2%`PaLSo%G1R$MC1J0OBXpA40xOz&;GN%&Fba( z^ylmXi4IlQ?-8!g47qv3Ug(rLHOIf;I45SpIV&gQ)00;l`7Om*MOIE&d>3d6gQu&X J%Q~loCIH==K=A+o literal 0 HcmV?d00001 diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index adc25f7160..6494e27616 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -2238,8 +2238,17 @@ span.mysql-number { .cPointer { background: url(./themes/pmahomme/img/col_pointer.png); - height: 20px; /* if the height changed, also change makegrid.js */ + height: 20px; margin-left: -5px; /* must be minus half of its width */ position: absolute; width: 10px; } + +.cPointerVer { /* cPointer with vertical display mode */ + background: url(./themes/pmahomme/img/col_pointer_ver.png); + height: 10px; + margin-left: -5px; + margin-top: -5px; /* must be minus half of its height */ + position: absolute; + width: 20px; +} diff --git a/themes/pmahomme/img/col_pointer.png b/themes/pmahomme/img/col_pointer.png index c62c2cdcc236757d01fc9ebc4434d57edb9bc7da..1d6e479e0b173bb47c17c20802ac3ec2c8fc85f4 100644 GIT binary patch delta 119 zcmcb?_?&TqIpAl$u X`LjfYi*8?RX8;0ES3j3^P6EaloaXvXEA>qe)2bP2+ z1)&}-nNM7j3r!Zb96Zr+a{|1ENkaQzdW?e>y|!I_y&YSB}TRSZDj>FVdQ I&MBb@0M3Ldd;kCd diff --git a/themes/pmahomme/img/col_pointer_ver.png b/themes/pmahomme/img/col_pointer_ver.png new file mode 100644 index 0000000000000000000000000000000000000000..ee43c5c738c2db417938dabfdb2f2be7d345ade3 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W=!3HF^gw{O+QjEnx?oJHr&dIz4a@dl*-CY>Y zg5Z=C9d4iqXMsm#F#`j)FbFd;%$g$s6l5>)^mS#w&Bn%IVZ0+MAr&YjS>hT|;+&tG zo0?a`;9QiNSdyBeP@Y+mq2TW68xY>eCk|BP;_2cTqH%uhrGvZ-3Oq~>39H`ye-*Z? z!Oh^Q@49{`h83$?op;UVI4u3G`&DR#Y|lZFsnI2Yi56xr?A#~MU|qKP;g=2OAr2Bk UzbYo40Gh|(>FVdQ&MBb@0Ow#wd;kCd literal 0 HcmV?d00001