summaryrefslogtreecommitdiff
path: root/public/vendor/jquery-textcomplete
diff options
context:
space:
mode:
authorWu Cheng-Han2015-09-25 13:39:08 +0800
committerWu Cheng-Han2015-09-25 13:39:08 +0800
commitf8b029b2f4e9801aa20b80c77b452537ff463de5 (patch)
tree8fa5fe28cde5ac2914d82eec330d455e80f890b7 /public/vendor/jquery-textcomplete
parentc4c9c4fed63249d21c1a06becc1257136ceafa1a (diff)
Fixed checkCursorTag and checkCursorMenu not calculate doc height properly, fixed jquery-textcomplete support upSideDown
Diffstat (limited to 'public/vendor/jquery-textcomplete')
-rwxr-xr-xpublic/vendor/jquery-textcomplete/jquery.textcomplete.js25
1 files changed, 11 insertions, 14 deletions
diff --git a/public/vendor/jquery-textcomplete/jquery.textcomplete.js b/public/vendor/jquery-textcomplete/jquery.textcomplete.js
index 145e2413..49881ce1 100755
--- a/public/vendor/jquery-textcomplete/jquery.textcomplete.js
+++ b/public/vendor/jquery-textcomplete/jquery.textcomplete.js
@@ -554,10 +554,16 @@ if (typeof jQuery === 'undefined') {
if (!this.shown) { return; }
if (this.isUp(e)) {
e.preventDefault();
- this._up();
+ if(typeof upSideDown != 'undefined' && upSideDown)
+ this._down();
+ else
+ this._up();
} else if (this.isDown(e)) {
e.preventDefault();
- this._down();
+ if(typeof upSideDown != 'undefined' && upSideDown)
+ this._up();
+ else
+ this._down();
} else if (this.isEnter(e)) {
e.preventDefault();
this._enter();
@@ -633,7 +639,7 @@ if (typeof jQuery === 'undefined') {
},
_getActiveElement: function () {
- return this.$el.children('.textcomplete-item:nth(' + this._index + ')');
+ return this.$el.children('.textcomplete-item[data-index=' + this._index + ']');
},
_setScroll: function () {
@@ -661,20 +667,11 @@ if (typeof jQuery === 'undefined') {
this.data.push(datum);
item.push(datum.strategy.template(datum.value));
}
- if(typeof upSideDown != 'undefined' && upSideDown) {
- for (i = item.length - 1; i >= 0; i--) {
- html += '<li class="textcomplete-item" data-index="' + i + '"><a>';
- html += item[i];
- html += '</a></li>';
- }
- this._index = this.data.length - 1;
- } else {
- for (i = 0; i < item.length; i++) {
+ for (i = 0; i < item.length; i++) {
html += '<li class="textcomplete-item" data-index="' + i + '"><a>';
html += item[i];
html += '</a></li>';
- }
- }
+ }
return html;
},