I am using tinymce to create a rich Textarea, and I am using backbone.js.
The problem is that when i move to that "page" in my router from a previous URL that is on the same site, it just doesn't work.
If i refresh the page with the direct link to that route it works fine. I really don't understand what can go wrong.
Here is the view:
var template = function (name) { var source = $('#' + name + '-template').html(); return Handlebars.compile(source); }; BT.Common.FormTextArea = Backbone.View.extend({ template : template('form-input-textarea'), tagName: 'div', className: "control-group", initialize: function(){ }, render: function(){ console.debug("Render FormTextArea"); var html = this.template(this.model.toJSON()); this.$el.html(html); tinymce.init({selector:'textarea'}); return this; }, });
The template:
<script type="text/x-handlebars-template" id="form-input-textarea-template"> <label class="control-label" for="message">{{lable}}</label> <div class="controls"> <textarea name="msgpost" id="msgpost" cols="50" rows="10"> {{text}} </textarea> </div> </script>