users: remove option to disable autocomplete.
This option was originally added in issue #1747. But only ~350 users ever disabled autocomplete, only ~120 of these were seen in the last year, and only 9 new users who signed up in the last year disabled it. Users wishing to disable autocomplete can use this CSS: .ui-autocomplete { display: none !important: } or this Javascript: $("[data-autocomplete]").autocomplete("disable");
This commit is contained in:
@@ -10,37 +10,35 @@ Autocomplete.TAG_PREFIXES = "-|~|" + Object.keys(Autocomplete.TAG_CATEGORIES).ma
|
||||
Autocomplete.MAX_RESULTS = 10;
|
||||
|
||||
Autocomplete.initialize_all = function() {
|
||||
if (CurrentUser.data("enable-auto-complete")) {
|
||||
$.widget("ui.autocomplete", $.ui.autocomplete, {
|
||||
options: {
|
||||
delay: 0,
|
||||
minLength: 1,
|
||||
autoFocus: false,
|
||||
focus: function() { return false; },
|
||||
},
|
||||
_create: function() {
|
||||
this.element.on("keydown.Autocomplete.tab", null, "tab", Autocomplete.on_tab);
|
||||
this._super();
|
||||
},
|
||||
_renderItem: Autocomplete.render_item,
|
||||
search: function(value, event) {
|
||||
if ($(this).data("ui-autocomplete")) {
|
||||
$(this).data("ui-autocomplete").menu.bindings = $();
|
||||
}
|
||||
this._super(value, event);
|
||||
},
|
||||
});
|
||||
$.widget("ui.autocomplete", $.ui.autocomplete, {
|
||||
options: {
|
||||
delay: 0,
|
||||
minLength: 1,
|
||||
autoFocus: false,
|
||||
focus: function() { return false; },
|
||||
},
|
||||
_create: function() {
|
||||
this.element.on("keydown.Autocomplete.tab", null, "tab", Autocomplete.on_tab);
|
||||
this._super();
|
||||
},
|
||||
_renderItem: Autocomplete.render_item,
|
||||
search: function(value, event) {
|
||||
if ($(this).data("ui-autocomplete")) {
|
||||
$(this).data("ui-autocomplete").menu.bindings = $();
|
||||
}
|
||||
this._super(value, event);
|
||||
},
|
||||
});
|
||||
|
||||
this.initialize_tag_autocomplete();
|
||||
this.initialize_mention_autocomplete($("form div.input.dtext textarea"));
|
||||
this.initialize_fields($('[data-autocomplete="tag"]'), "tag");
|
||||
this.initialize_fields($('[data-autocomplete="artist"]'), "artist");
|
||||
this.initialize_fields($('[data-autocomplete="pool"]'), "pool");
|
||||
this.initialize_fields($('[data-autocomplete="user"]'), "user");
|
||||
this.initialize_fields($('[data-autocomplete="wiki-page"]'), "wiki_page");
|
||||
this.initialize_fields($('[data-autocomplete="favorite-group"]'), "favorite_group");
|
||||
this.initialize_fields($('[data-autocomplete="saved-search-label"]'), "saved_search_label");
|
||||
}
|
||||
this.initialize_tag_autocomplete();
|
||||
this.initialize_mention_autocomplete($("form div.input.dtext textarea"));
|
||||
this.initialize_fields($('[data-autocomplete="tag"]'), "tag");
|
||||
this.initialize_fields($('[data-autocomplete="artist"]'), "artist");
|
||||
this.initialize_fields($('[data-autocomplete="pool"]'), "pool");
|
||||
this.initialize_fields($('[data-autocomplete="user"]'), "user");
|
||||
this.initialize_fields($('[data-autocomplete="wiki-page"]'), "wiki_page");
|
||||
this.initialize_fields($('[data-autocomplete="favorite-group"]'), "favorite_group");
|
||||
this.initialize_fields($('[data-autocomplete="saved-search-label"]'), "saved_search_label");
|
||||
}
|
||||
|
||||
Autocomplete.initialize_fields = function($fields, type) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import CurrentUser from './current_user'
|
||||
import Post from './posts.js.erb'
|
||||
import Utility from './utility'
|
||||
|
||||
@@ -77,9 +76,7 @@ PostModeMenu.initialize_edit_form = function() {
|
||||
|
||||
PostModeMenu.close_edit_form = function() {
|
||||
$("#quick-edit-div").slideUp("fast");
|
||||
if (CurrentUser.data("enable-auto-complete")) {
|
||||
$("#post_tag_string").data("uiAutocomplete").close();
|
||||
}
|
||||
$("#post_tag_string").data("uiAutocomplete").close();
|
||||
}
|
||||
|
||||
PostModeMenu.initialize_tag_script_field = function() {
|
||||
|
||||
@@ -117,9 +117,7 @@ Post.open_edit_dialog = function() {
|
||||
of: window
|
||||
},
|
||||
drag: function(e, ui) {
|
||||
if (CurrentUser.data("enable-auto-complete")) {
|
||||
$tag_string.data("uiAutocomplete").close();
|
||||
}
|
||||
$tag_string.data("uiAutocomplete").close();
|
||||
},
|
||||
close: Post.close_edit_dialog
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user