Modified: trunk/public/_javascript_s/controls.js (3071 => 3072)
--- trunk/public/_javascript_s/controls.js 2012-08-02 16:02:57 UTC (rev 3071)
+++ trunk/public/_javascript_s/controls.js 2012-08-03 14:16:08 UTC (rev 3072)
@@ -208,16 +208,32 @@
}
},
+ // Added this fix: http://www.gilluminate.com/2009/01/20/scriptaculous-autocomplete-page-jump-using-arrow-keys/
+
markPrevious: function() {
- if(this.index > 0) this.index--;
- else this.index = this.entryCount-1;
- this.getEntry(this.index).scrollIntoView(true);
+ if(this.index > 0) {this.index--;}
+ else {
+ this.index = this.entryCount-1;
+ this.update.scrollTop = this.update.scrollHeight;
+ }
+ selection = this.getEntry(this.index);
+ selection_top = selection.offsetTop;
+ if(selection_top < this.update.scrollTop){
+ this.update.scrollTop = this.update.scrollTop-selection.offsetHeight;
+ }
},
markNext: function() {
- if(this.index < this.entryCount-1) this.index++;
- else this.index = 0;
- this.getEntry(this.index).scrollIntoView(false);
+ if(this.index < this.entryCount-1) {this.index++;}
+ else {
+ this.index = 0;
+ this.update.scrollTop = 0;
+ }
+ selection = this.getEntry(this.index);
+ selection_bottom = selection.offsetTop+selection.offsetHeight;
+ if(selection_bottom > this.update.scrollTop+this.update.offsetHeight){
+ this.update.scrollTop = this.update.scrollTop+selection.offsetHeight;
+ }
},
getEntry: function(index) {
@@ -281,6 +297,7 @@
}
this.stopIndicator();
+ this.update.scrollTop = 0;
this.index = 0;
if(this.entryCount==1 && this.options.autoSelect) {