inputosaurus jQuery to native so we can drop jquery-ui

This commit is contained in:
djmaze 2020-09-21 16:05:04 +02:00
parent ea2e0c09d8
commit 06abbf0713
33 changed files with 422 additions and 7584 deletions

View file

@ -1,5 +1,4 @@
const ko = window.ko,
$ = jQuery,
rlContentType = 'application/x-rainloop-action',
validTransfer = data => ['move','copy'].includes(data.dropEffect) // effectAllowed
&& data.getData('application/x-rainloop-messages');
@ -39,24 +38,18 @@ ko.bindingHandlers.moment = {
ko.bindingHandlers.emailsTags = {
init: (element, fValueAccessor, fAllBindingsAccessor) => {
const EmailModel = require('Model/Email').default,
$el = $(element),
fValue = fValueAccessor(),
fAllBindings = fAllBindingsAccessor(),
inputDelimiters = [',', ';', '\n'];
$el.inputosaurus({
focusCallback: value => {
if (fValue && fValue.focused) {
fValue.focused(!!value);
}
},
element.inputosaurus = new window.Inputosaurus(element, {
focusCallback: value => fValue && fValue.focused && fValue.focused(!!value),
autoCompleteSource: fAllBindings.autoCompleteSource || null,
splitHook: value => {
const v = value.trim();
if (v && inputDelimiters.includes(v.substr(-1))) {
return EmailModel.splitEmailLine(value);
}
return null;
return (v && inputDelimiters.includes(v.substr(-1)))
? EmailModel.splitEmailLine(value)
: null;
},
parseHook: input =>
input.map(inputValue => {
@ -72,8 +65,8 @@ ko.bindingHandlers.emailsTags = {
});
if (fValue && fValue.focused && fValue.focused.subscribe) {
fValue.focused.subscribe((value) => {
$el.inputosaurus(value ? 'focus' : 'blur');
fValue.focused.subscribe(value => {
element.inputosaurus[value ? 'focus' : 'blur']();
});
}
},
@ -83,7 +76,7 @@ ko.bindingHandlers.emailsTags = {
if (element.EmailsTagsValue !== value) {
element.value = value;
element.EmailsTagsValue = value;
$(element).inputosaurus('refresh');
element.inputosaurus.refresh();
}
}
};

View file

@ -304,10 +304,6 @@ html.rl-left-panel-disabled {
.hide-on-panel-disabled {
display: none;
}
&.ui-state-disabled {
opacity: 1;
}
}
#rl-right {

View file

@ -92,19 +92,6 @@
cursor: pointer;
opacity: 0.5;
}
&.ui-sortable-helper {
background: #F5F5F5;
border: 1px solid #DDD;
.button-delete, .delete-account {
display: none;
}
td {
border-width: 0;
}
}
}
.identity-item {
@ -134,18 +121,5 @@
cursor: pointer;
opacity: 0.5;
}
&.ui-sortable-helper {
background: #F5F5F5;
border: 1px solid #DDD;
.button-delete, .delete-identity {
display: none;
}
td {
border-width: 0;
}
}
}
}

View file

@ -88,18 +88,5 @@
cursor: pointer;
opacity: 0.5;
}
&.ui-sortable-helper {
background: #F5F5F5;
border: 1px solid #DDD;
.button-delete, .delete-filter {
display: none;
}
td {
border-width: 0;
}
}
}
}

View file

@ -77,18 +77,5 @@
cursor: pointer;
opacity: 0.5;
}
&.ui-sortable-helper {
background: #F5F5F5;
border: 1px solid #DDD;
.button-delete, .delete-template {
display: none;
}
td {
border-width: 0;
}
}
}
}

View file

@ -26,10 +26,6 @@
color: #555;
z-index: 100;
&.ui-draggable.ui-draggable-dragging {
z-index: 101;
}
position: relative;
a {
@ -74,10 +70,6 @@
}
}
.ui-autocomplete {
z-index: 2000;
}
.inputosaurus-fake-span {
position: absolute;
top: 0;