From 1bf3d3376570cfbb66b6a9ecf6c06d2fccc74932 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Wed, 15 Jan 2014 03:22:49 -0500 Subject: [PATCH] prevent clicks on autocomplete to scroll window to the top --- public/src/modules/composer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 17e5590aec..0c584af0e8 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -5,7 +5,7 @@ define(['taskbar'], function(taskbar) { }; function allowed() { - if(!(parseInt(app.uid, 10) > 0 || parseInt(config.allowGuestPosting, 10) === 1)) { + if(!(parseInt(app.uid, 10) > 0 || config.allowGuestPosting)) { app.alert({ type: 'danger', timeout: 5000, @@ -146,6 +146,8 @@ define(['taskbar'], function(taskbar) { } } + + $(bodyEl).autocomplete({ source: function(request, response) { var term = request.term; @@ -181,6 +183,7 @@ define(['taskbar'], function(taskbar) { $(bodyEl).val(firstPart + ui.item.value + lastPart); $(bodyEl).selectRange(index + ui.item.value.length); } + event.preventDefault(); return false; }, position: { my : "left bottom", at: "left bottom" }