diff --git a/src/navigator/view/ItemView.ts b/src/navigator/view/ItemView.ts
index 772a67f89..32e05c781 100644
--- a/src/navigator/view/ItemView.ts
+++ b/src/navigator/view/ItemView.ts
@@ -76,7 +76,7 @@ export default class ItemView extends View {
- ${count ? `
${count || ''}
` : ''}
+
${count || ''}
${move || ''}
@@ -115,10 +115,8 @@ export default class ItemView extends View {
clsEdit: string;
clsNoEdit: string;
_rendered?: boolean;
- eyeEl?: JQuery;
caret?: JQuery;
inputName?: HTMLElement;
- cnt?: HTMLElement;
constructor(opt: ItemViewProps) {
super(opt);
@@ -174,11 +172,7 @@ export default class ItemView extends View {
}
getVisibilityEl() {
- if (!this.eyeEl) {
- this.eyeEl = this.$el.children('[data-toggle-select]').find('[data-toggle-visible]');
- }
-
- return this.eyeEl;
+ return this.getItemContainer().find('[data-toggle-visible]');
}
updateVisibility() {
@@ -346,30 +340,30 @@ export default class ItemView extends View {
]);
}
+ getItemContainer() {
+ return this.$el.children('[data-toggle-select]');
+ }
+
/**
* Update item aspect after children changes
*
* @return void
* */
checkChildren() {
- const { model, clsNoChild, $el, module } = this;
+ const { model, clsNoChild, module } = this;
const count = module.getComponents(model).length;
- const title = $el.children(`.${this.clsTitleC}`).children(`.${this.clsTitle}`);
- let { cnt } = this;
-
- if (!cnt) {
- cnt = $el.children('[data-count]').get(0);
- this.cnt = cnt;
- }
+ const itemEl = this.getItemContainer();
+ const title = itemEl.find(`.${this.clsTitle}`);
+ const countEl = itemEl.find('[data-count]');
title[count ? 'removeClass' : 'addClass'](clsNoChild);
- if (cnt) cnt.innerHTML = count || '';
+ countEl.html(count || '');
!count && module.setOpen(model, false);
}
getCaret() {
if (!this.caret || !this.caret.length) {
- this.caret = this.$el.children(`.${this.clsTitleC}`).find(`.${this.clsCaret}`);
+ this.caret = this.getItemContainer().find(`.${this.clsCaret}`);
}
return this.caret;