Created
January 18, 2016 18:43
-
-
Save SpencerCooley/da8fe4cb7ad9fb5f57d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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