Skip to content

Commit

Permalink
fix autocomplete... again. (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Aug 31, 2018
1 parent 220a5a8 commit fe88bc7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 34 deletions.
65 changes: 33 additions & 32 deletions nodes/ccu-rpc-event.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,39 @@
let ifacesLoaded = false;
let ifacesPending = false;

$('.filter').each(function () {
const id = $(this).prop('id');
const $type = $('#' + id + 'Rx');
const name = id.split('-').pop() + 'Rx';
$type.val(that[name]);

const $this = $(this);

$this.typedInput({
typeField: $type,
types: ['str', 're']
}).typedInput('width', '70%');

const $input = $this.parent().find('.red-ui-typedInput-input input');

$input.autocomplete({
source: [],
close: () => {
$input.trigger('change');
},
delay: 0,
minLength: 0
});

$this.on('change', (type, value) => {
if (value === 're') {
$input.autocomplete('disable');
} else {
$input.autocomplete('enable');
}
});
});

function loadIfaces(iface, cb) {
if (ifacesPending) {
return;
Expand Down Expand Up @@ -102,38 +135,6 @@
autocompleteDevices();
});

$('.filter').each(function () {
const id = $(this).prop('id');
const $type = $('#' + id + 'Rx');
const name = id.split('-').pop() + 'Rx';
$type.val(that[name]);

const $this = $(this);
const $input = $this.parent().find('.red-ui-typedInput-input input');

$this.typedInput({
typeField: $type,
types: ['str', 're']
}).typedInput('width', '70%');

$input.autocomplete({
source: [],
close: () => {
$input.trigger('change');
},
delay: 0,
minLength: 0
});

$this.on('change', (type, value) => {
if (value === 're') {
$input.autocomplete('disable');
} else {
$input.autocomplete('enable');
}
});
});

function autocompleteRoomsFunctions() {
if (!data) {
return;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-ccu",
"version": "1.4.2",
"version": "1.4.3",
"description": "Node-RED Nodes for the Homematic CCU",
"repository": "https://github.com/hobbyquaker/node-red-contrib-ccu",
"keywords": [
Expand Down

0 comments on commit fe88bc7

Please sign in to comment.