Skip to content

Instantly share code, notes, and snippets.

@SpencerCooley
Created January 18, 2016 18:43
Show Gist options
  • Save SpencerCooley/32198a709d6717362bec to your computer and use it in GitHub Desktop.
Save SpencerCooley/32198a709d6717362bec to your computer and use it in GitHub Desktop.
var JST = require('../JST.js');
var QuillView = Backbone.View.extend({
//el should be passed in
template: JST.quillEditor,
initialize: function(options){
this.el = options.el
this.render()
},
initQuill: function(){
var configs = {
'modules': {
'link-tooltip': true,
'toolbar': { container: '.tb-quill-selector-'+this.model.get('id') }
},
'theme':'snow'
}
var quill = new Quill('.quill-editor-selector-'+this.model.get('id'), configs);
},
render: function(){
//add template for quill
this.$el.filter('[data-id='+this.model.get('id')+']').html(this.template(this.model.toJSON()))
console.log($('.module-container').filter('[data-id=1]'))
//initialize quill
this.initQuill()
return this;
}
});
module.exports = QuillView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment