scinote-web/app/javascript/vue/protocol/mixins/utils.js
artoscinote 23872f519b
Implement step element sorting modal [SCI-6849] (#4124)
* Implement step element sorting modal [SCI-6849]

* Implement step reordering modal [SCI-6850]

* Refactor reorderable items a bit [SCI-6850]
2022-05-30 13:45:51 +02:00

19 lines
399 B
JavaScript

/* global ActiveStorage GLOBAL_CONSTANTS Promise i18n */
export default {
methods: {
stripHtml(html) {
let tmp = document.createElement("DIV");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || "";
},
truncate(text, length) {
if (text.length > length) {
return text.substring(0, length) + '...';
}
return text;
}
}
};