mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #4710 from G-Chubinidze/gc_SCI_7195
Text block on step without title in rearrange modal [SCI-7195]
This commit is contained in:
commit
87fa3bc9a7
1 changed files with 11 additions and 2 deletions
|
@ -23,8 +23,8 @@
|
|||
<div class="step-element-name">
|
||||
<strong v-if="includeNumbers" class="step-element-number">{{ index + 1 }}</strong>
|
||||
<i v-if="item.attributes.icon" class="fas" :class="item.attributes.icon"></i>
|
||||
<span :title="item.attributes.name" v-if="item.attributes.name">{{ item.attributes.name }}</span>
|
||||
<span v-else class="step-element-name-placeholder">{{ item.attributes.placeholder }}</span>
|
||||
<span :title="nameWithFallbacks(item)" v-if="nameWithFallbacks(item)">{{ nameWithFallbacks(item) }}</span>
|
||||
<span :title="item.attributes.placeholder" v-else class="step-element-name-placeholder">{{ item.attributes.placeholder }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</Draggable>
|
||||
|
@ -73,6 +73,15 @@
|
|||
this.$nextTick(() => {
|
||||
$(this.$refs.modal).modal('hide');
|
||||
});
|
||||
},
|
||||
getTitle(item) {
|
||||
let $item_html = $(item.attributes.text);
|
||||
$item_html.remove('table, img');
|
||||
let str = $item_html.text().trim();
|
||||
return str.length > 56 ? str.slice(0, 56) + "..." : str;
|
||||
},
|
||||
nameWithFallbacks(item) {
|
||||
return item.attributes.name || this.getTitle(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue