mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Battling Chrome Autocomplete, part 31: Wrap search input with form
This commit is contained in:
parent
53b127902c
commit
634a51635c
@ -38,7 +38,10 @@
|
|||||||
this.element.addClass("red-ui-searchBox-input");
|
this.element.addClass("red-ui-searchBox-input");
|
||||||
this.uiContainer = this.element.wrap("<div>").parent();
|
this.uiContainer = this.element.wrap("<div>").parent();
|
||||||
this.uiContainer.addClass("red-ui-searchBox-container");
|
this.uiContainer.addClass("red-ui-searchBox-container");
|
||||||
|
if (this.element.parents("form").length === 0) {
|
||||||
|
var form = this.element.wrap("<form>").parent();
|
||||||
|
form.addClass("red-ui-searchBox-form");
|
||||||
|
}
|
||||||
$('<i class="fa fa-search"></i>').prependTo(this.uiContainer);
|
$('<i class="fa fa-search"></i>').prependTo(this.uiContainer);
|
||||||
this.clearButton = $('<a href="#"><i class="fa fa-times"></i></a>').appendTo(this.uiContainer);
|
this.clearButton = $('<a href="#"><i class="fa fa-times"></i></a>').appendTo(this.uiContainer);
|
||||||
this.clearButton.on("click",function(e) {
|
this.clearButton.on("click",function(e) {
|
||||||
|
@ -524,12 +524,12 @@ RED.keyboard = (function() {
|
|||||||
var pane = $('<div id="red-ui-settings-tab-keyboard"></div>');
|
var pane = $('<div id="red-ui-settings-tab-keyboard"></div>');
|
||||||
|
|
||||||
$('<div class="keyboard-shortcut-entry keyboard-shortcut-list-header">'+
|
$('<div class="keyboard-shortcut-entry keyboard-shortcut-list-header">'+
|
||||||
'<div class="keyboard-shortcut-entry-key keyboard-shortcut-entry-text"><input id="red-ui-settings-tab-keyboard-filter" type="text" data-i18n="[placeholder]keyboard.filterActions"></div>'+
|
'<div class="keyboard-shortcut-entry-key keyboard-shortcut-entry-text"><input autocomplete="off" name="keyboard-filter" id="red-ui-settings-tab-keyboard-filter" type="text" data-i18n="[placeholder]keyboard.filterActions"></div>'+
|
||||||
'<div class="keyboard-shortcut-entry-key" data-i18n="keyboard.shortcut"></div>'+
|
'<div class="keyboard-shortcut-entry-key" data-i18n="keyboard.shortcut"></div>'+
|
||||||
'<div class="keyboard-shortcut-entry-scope" data-i18n="keyboard.scope"></div>'+
|
'<div class="keyboard-shortcut-entry-scope" data-i18n="keyboard.scope"></div>'+
|
||||||
'</div>').appendTo(pane);
|
'</div>').appendTo(pane);
|
||||||
|
|
||||||
pane.find("input").searchBox({
|
pane.find("#red-ui-settings-tab-keyboard-filter").searchBox({
|
||||||
delay: 100,
|
delay: 100,
|
||||||
change: function() {
|
change: function() {
|
||||||
var filterValue = $(this).val().trim();
|
var filterValue = $(this).val().trim();
|
||||||
|
@ -30,13 +30,13 @@ RED.projects.userSettings = (function() {
|
|||||||
$('<div class="red-ui-settings-section-description"></div>').appendTo(gitconfigContainer).text(RED._("editor:sidebar.project.userSettings.committerTip"));
|
$('<div class="red-ui-settings-section-description"></div>').appendTo(gitconfigContainer).text(RED._("editor:sidebar.project.userSettings.committerTip"));
|
||||||
|
|
||||||
var row = $('<div class="red-ui-settings-row"></div>').appendTo(gitconfigContainer);
|
var row = $('<div class="red-ui-settings-row"></div>').appendTo(gitconfigContainer);
|
||||||
$('<label for=""></label>').text(RED._("editor:sidebar.project.userSettings.userName")).appendTo(row);
|
$('<label for="user-settings-gitconfig-username"></label>').text(RED._("editor:sidebar.project.userSettings.userName")).appendTo(row);
|
||||||
gitUsernameInput = $('<input type="text">').appendTo(row);
|
gitUsernameInput = $('<input type="text" id="user-settings-gitconfig-username">').appendTo(row);
|
||||||
gitUsernameInput.val(currentGitSettings.user.name||"");
|
gitUsernameInput.val(currentGitSettings.user.name||"");
|
||||||
|
|
||||||
row = $('<div class="red-ui-settings-row"></div>').appendTo(gitconfigContainer);
|
row = $('<div class="red-ui-settings-row"></div>').appendTo(gitconfigContainer);
|
||||||
$('<label for=""></label>').text(RED._("editor:sidebar.project.userSettings.email")).appendTo(row);
|
$('<label for="user-settings-gitconfig-email"></label>').text(RED._("editor:sidebar.project.userSettings.email")).appendTo(row);
|
||||||
gitEmailInput = $('<input type="text">').appendTo(row);
|
gitEmailInput = $('<input type="text" id="user-settings-gitconfig-email">').appendTo(row);
|
||||||
gitEmailInput.val(currentGitSettings.user.email||"");
|
gitEmailInput.val(currentGitSettings.user.email||"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
right: 5px;
|
right: 5px;
|
||||||
top: 9px;
|
top: 9px;
|
||||||
}
|
}
|
||||||
|
form.red-ui-searchBox-form {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
input.red-ui-searchBox-input {
|
input.red-ui-searchBox-input {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border: none;
|
border: none;
|
||||||
|
Loading…
Reference in New Issue
Block a user