patch #2812070 [interface] Allow selecting a range of rows by holding shift, thanks to Joolee

This commit is contained in:
Herman van Rink
2009-12-27 19:01:59 +00:00
parent 61dbb88e15
commit 62cb15b4a3
2 changed files with 36 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
+ rfe #2862575 [status] Order query statistics by % desc, skip rows with 0
+ rfe #2823686 [interface] Increase default height of query window
+ rfe #2129902 [structure] Don't hide indexes
+ patch #2812070 [interface] Allow selecting a range of rows by holding shift, thanks to Joolee
3.2.5.0 (not yet released)
- patch #2903400 [bookmarks] Status of bookmark table,

View File

@@ -836,10 +836,14 @@ function PMA_markRowsInit() {
continue;
}
// ... and to mark the row on click ...
rows[i].onmousedown = function() {
rows[i].onmousedown = function(event) {
var unique_id;
var checkbox;
var table;
// Somehow IE8 has this not set
if (!event) var event = window.event
checkbox = this.getElementsByTagName( 'input' )[0];
if ( checkbox && checkbox.type == 'checkbox' ) {
unique_id = checkbox.name + checkbox.value;
@@ -863,6 +867,36 @@ function PMA_markRowsInit() {
if ( checkbox && checkbox.disabled == false ) {
checkbox.checked = marked_row[unique_id];
if (typeof(event) == 'object') {
table = this.parentNode;
i = 0;
while (table.tagName.toLowerCase() != 'table' && i < 20) {
i++;
table = table.parentNode;
}
if (event.shiftKey == true && table.lastClicked != undefined) {
if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
i = table.lastClicked;
if (i < this.rowIndex) {
i++;
} else {
i--;
}
while (i != this.rowIndex) {
table.rows[i].onmousedown();
if (i < this.rowIndex) {
i++;
} else {
i--;
}
}
}
table.lastClicked = this.rowIndex;
}
}
}