Browse Source

Avoid false positive warnings with traits. Closes #2615

pull/2620/head
Artur Arseniev 7 years ago
parent
commit
83754ddb0f
  1. 31
      src/domain_abstract/view/DomainViews.js

31
src/domain_abstract/view/DomainViews.js

@ -1,3 +1,4 @@
import { includes } from 'underscore';
import Backbone from 'backbone';
export default Backbone.View.extend({
@ -45,6 +46,30 @@ export default Backbone.View.extend({
* */
add(model, fragment) {
const { config, reuseView, itemsView = {} } = this;
const inputTypes = [
'button',
'checkbox',
'color',
'date',
'datetime-local',
'email',
'file',
'hidden',
'image',
'month',
'number',
'password',
'radio',
'range',
'reset',
'search',
'submit',
'tel',
'text',
'time',
'url',
'week'
];
var frag = fragment || null;
var itemView = this.itemView;
var typeField = model.get(this.itemType);
@ -52,7 +77,11 @@ export default Backbone.View.extend({
if (itemsView[typeField]) {
itemView = itemsView[typeField];
} else if (typeField && !itemsView[typeField]) {
} else if (
typeField &&
!itemsView[typeField] &&
!includes(inputTypes, typeField)
) {
this.itemViewNotFound(typeField);
}

Loading…
Cancel
Save