Skip to content

Commit

Permalink
Editors and popup fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Guryev authored and Stanislav Guryev committed Aug 2, 2022
1 parent 2f34ac5 commit 8f52de8
Show file tree
Hide file tree
Showing 8 changed files with 324 additions and 306 deletions.
4 changes: 2 additions & 2 deletions src/form/editors/DatalistEditorView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ export default (formRepository.editors.Datalist = BaseEditorView.extend({
template: Handlebars.compile(template),

setValue(value, { triggerChange = false, isLoadIfNeeded = true } = {}): void {
if(this.options.isAutocompleteMode) {
this.dropdownView.setInputValue(value);
if (this.options.isAutocompleteMode) {
this.dropdownView.setValue(value);
}
this.__value(value, { triggerChange, isLoadIfNeeded });
},
Expand Down
4 changes: 3 additions & 1 deletion src/form/formRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Https from './validators/httpsValidator';
import Telegram from './validators/tgValidator';
import MailTo from './validators/mailtoValidator';
import Ftp from './validators/ftpValidator';
import Ftps from './validators/ftpsValidator';
import Git from './validators/gitValidator';
import Ssh from './validators/sshValidator';

Expand All @@ -33,7 +34,8 @@ export default {
mailto: MailTo,
git: Git,
ssh: Ssh,
ftp: Ftp
ftp: Ftp,
ftps: Ftps
},
getValidator(validator: string | Function) {
const validators = this.validators;
Expand Down
2 changes: 1 addition & 1 deletion src/form/validators/ftpsValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default () =>

const err = {
type: 'uri',
message: LocalizationService.get('CORE.FORM.EDITORS.URIEDITOR.MSGVALIDATORFTP')
message: LocalizationService.get('CORE.FORM.EDITORS.URIEDITOR.MSGVALIDATORFTPS')
};
if (!/^ftps:\/\//.test(value)) {
return err;
Expand Down
2 changes: 1 addition & 1 deletion src/form/validators/tgValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default () =>
type: 'uri',
message: LocalizationService.get('CORE.FORM.EDITORS.URIEDITOR.MSGVALIDATORTELEGRAM')
};
if (!/^tg:\/\//.test(value)) {
if (!/^https:\/\/t.me\//.test(value)) {
return err;
}
};
3 changes: 1 addition & 2 deletions src/layout/tabLayout/TabLayoutView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,16 @@ export default Marionette.View.extend({
const region = this.addRegion(`${tabModel.id}TabRegion`, {
el: regionEl
});
isLoadingNeeded && this.setLoading(true);
const __view = this.tabsViewById[tabModel.id];
const view = typeof __view === 'function' ? __view(tabModel) : __view;
if (helpers.isPromise(view)) {
isLoadingNeeded && this.setLoading(true);
view.then((_view: Backbone.View) => {
this.showTab({ view: _view, tabModel, region, regionEl });
isLoadingNeeded && this.setLoading(false);
});
} else {
this.showTab({ view, tabModel, region, regionEl });
isLoadingNeeded && this.setLoading(false);
}
},

Expand Down
Loading

0 comments on commit 8f52de8

Please sign in to comment.