Skip to content

Commit

Permalink
Merge pull request #63 from mostafaznv/dev
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
mostafaznv authored Jul 5, 2023
2 parents 003dacb + df5fba0 commit ef11e95
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ export default class VideoLoadObserver extends Observer {
this.document.fire('videoLoaded', domEvent);
}
}

stopObserving(domRoot) {
this.stopListening(domRoot);
}
}
16 changes: 10 additions & 6 deletions resources/js/components/editor-index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ export default {
props: ['resourceName', 'field'],
computed: {
value() {
let value = this.field.value
.replace(/<[^>]*(>|$)|&nbsp;|&zwnj;|&raquo;|&laquo;|&gt;/g, ' ')
.replace(/(<([^>]+)>)/gi, '')
if (this.field.value) {
let value = this.field.value
.replace(/<[^>]*(>|$)|&nbsp;|&zwnj;|&raquo;|&laquo;|&gt;/g, ' ')
.replace(/(<([^>]+)>)/gi, '')
if (value.length <= this.field.indexLimit) {
return value
if (value.length <= this.field.indexLimit) {
return value
}
return value.substring(0, this.field.indexLimit) + '...'
}
return value.substring(0, this.field.indexLimit) + '...'
return ''
}
}
}
Expand Down

0 comments on commit ef11e95

Please sign in to comment.