mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
prevent clicks on autocomplete to scroll window to the top
This commit is contained in:
@@ -5,7 +5,7 @@ define(['taskbar'], function(taskbar) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function allowed() {
|
function allowed() {
|
||||||
if(!(parseInt(app.uid, 10) > 0 || parseInt(config.allowGuestPosting, 10) === 1)) {
|
if(!(parseInt(app.uid, 10) > 0 || config.allowGuestPosting)) {
|
||||||
app.alert({
|
app.alert({
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
@@ -146,6 +146,8 @@ define(['taskbar'], function(taskbar) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(bodyEl).autocomplete({
|
$(bodyEl).autocomplete({
|
||||||
source: function(request, response) {
|
source: function(request, response) {
|
||||||
var term = request.term;
|
var term = request.term;
|
||||||
@@ -181,6 +183,7 @@ define(['taskbar'], function(taskbar) {
|
|||||||
$(bodyEl).val(firstPart + ui.item.value + lastPart);
|
$(bodyEl).val(firstPart + ui.item.value + lastPart);
|
||||||
$(bodyEl).selectRange(index + ui.item.value.length);
|
$(bodyEl).selectRange(index + ui.item.value.length);
|
||||||
}
|
}
|
||||||
|
event.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
position: { my : "left bottom", at: "left bottom" }
|
position: { my : "left bottom", at: "left bottom" }
|
||||||
|
|||||||
Reference in New Issue
Block a user