Skip to content

Commit

Permalink
feat: enhanced column features
Browse files Browse the repository at this point in the history
Add Enhanced Bootstrap Column Features for FormBuilder
  • Loading branch information
kevinchappell authored Mar 17, 2022
2 parents 3ccc520 + 9775ca7 commit 023f8b7
Show file tree
Hide file tree
Showing 9 changed files with 1,666 additions and 159 deletions.
4 changes: 4 additions & 0 deletions src/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export const defaultOptions = {
typeUserAttrs: {},
typeUserDisabledAttrs: {},
typeUserEvents: {},
defaultGridColumnClass: 'col-md-12',
cancelGridModeDistance: 100,
enableColumnInsertMenu: false,
enableEnhancedBootstrapGrid: false,
}

export const styles = {
Expand Down
20 changes: 16 additions & 4 deletions src/js/control/textarea.tinymce.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import controlTextarea from './textarea'
* var renderOpts = {
* controlConfig: {
* 'textarea.tinymce': {
* paste_data_images: false
* }
* paste_data_images: false
* }
* }
* };
* ```
Expand Down Expand Up @@ -80,13 +80,25 @@ export default class controlTinymce extends controlTextarea {
// define options & allow them to be overwritten in the class config
const options = jQuery.extend(this.editorOptions, this.classConfig)
options.target = this.field
// initialise the editor
window.tinymce.init(options)

setTimeout(() => {
// initialise the editor
window.tinymce.init(options)
}, 100)

// Set userData
if (this.config.userData) {
window.tinymce.editors[this.id].setContent(this.parsedHtml(this.config.userData[0]))
}

if (window.lastFormBuilderCopiedTinyMCE) {
const timeout = setTimeout(() => {
window.tinymce.editors[this.id].setContent(this.parsedHtml(window.lastFormBuilderCopiedTinyMCE))
window.lastFormBuilderCopiedTinyMCE = null
clearTimeout(timeout)
}, 300)
}

return evt
}
}
Expand Down
Loading

0 comments on commit 023f8b7

Please sign in to comment.