Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to apply CodeMirror in Bootstrap Modal

var myCodeMirror = CodeMirror(document.querySelector('.codemirror-init'), {
  value: 'Your Value',
  lineNumbers: true,
  tabSize: 2,
  mode: 'javascript',
  theme: 'monokai'
});

$('#exampleModal').on('shown.bs.modal', function() {
    // Refresh Code mirror Here
       myCodeMirror.refresh();
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #apply #CodeMirror #Bootstrap #Modal
ADD COMMENT
Topic
Name
8+2 =