Javascript 渲染主干视图后,Tinymce不再工作
我在使用带有backbone.js的TinyMCE v4时遇到问题。 当我刷新页面时,编辑器工作正常,但当我使用路由器导航时,它不工作Javascript 渲染主干视图后,Tinymce不再工作,javascript,backbone.js,tinymce,Javascript,Backbone.js,Tinymce,我在使用带有backbone.js的TinyMCE v4时遇到问题。 当我刷新页面时,编辑器工作正常,但当我使用路由器导航时,它不工作 APP.Views.AddEdit = Backbone.View.extend({ el:'#addEditHolder', initialize: function() { _.bindAll(this, 'render', 'saveModel');
APP.Views.AddEdit = Backbone.View.extend({
el:'#addEditHolder',
initialize: function() {
_.bindAll(this, 'render', 'saveModel');
this.listenTo(this.model, 'change', this.render);
vent.on("model:save", this.saveModel, this);
this.render();
this.form = this.$('form');
this.name = this.form.find('#addedit_name');
this.description = this.form.find('#addedit_description');
},
template: APP.template2( 'addEditTemplate' ),
render: function() {
this.$el.html(this.template(this.model.toJSON()));
tinymce.init({
selector: "textarea.richContent",
theme: "modern",
width: '100%',
height: 240
});
return this;
},
saveModel: function() {
this.model.save({
name:this.name.val(),
description:this.description.val()
},
{
wait: true,
patch: true
});
}
});
可能的答案;