mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
796 B
29 lines
796 B
import { filter } from 'underscore';
|
|
import { Collection } from 'common';
|
|
import Selector from './Selector';
|
|
|
|
export default class Selectors extends Collection {
|
|
getStyleable() {
|
|
return filter(
|
|
this.models,
|
|
item => item.get('active') && !item.get('private')
|
|
);
|
|
}
|
|
|
|
getValid({ noDisabled } = {}) {
|
|
return filter(this.models, item => !item.get('private')).filter(item =>
|
|
noDisabled ? item.get('active') : 1
|
|
);
|
|
}
|
|
|
|
getFullString(collection, opts = {}) {
|
|
const result = [];
|
|
const coll = collection || this;
|
|
coll.forEach(selector => result.push(selector.getFullName(opts)));
|
|
return result.join('').trim();
|
|
}
|
|
}
|
|
|
|
Selectors.prototype.model = Selector;
|
|
Selectors.prototype.modelId = attr =>
|
|
`${attr.name}_${attr.type || Selector.TYPE_CLASS}`;
|
|
|