Skip to content

Instantly share code, notes, and snippets.

@lifeinafolder
Created December 5, 2012 13:10
Show Gist options
  • Select an option

  • Save lifeinafolder/4215388 to your computer and use it in GitHub Desktop.

Select an option

Save lifeinafolder/4215388 to your computer and use it in GitHub Desktop.
Ember-Redactor.js
RedactorView = Ember.View.extend({
templateName: 'redactor',
didInsertElement: function () {
require('editor/vendor/redactor/redactor');
// If 'css' is not injected yet, inject it.
if (!Utils.hasCss('css/redactor.css')) {
$('head').append('<link rel="stylesheet" href="css/redactor.css" type="text/css" />');
}
this.$('#redactor').redactor();
}
});
<div class="redactor-wrapper">
<textarea id="redactor" name="content">
</div>
@lifeinafolder

Copy link
Copy Markdown
Author

Requiring redactor.js v.8.2.1 fails inside that didInsertElement. This is because minispade is trying to eval that code when the view is instantiated. Evaling fails in redactor.js where it is using packer.

@kroofy

kroofy commented Feb 4, 2013

Copy link
Copy Markdown

Have you successfully implemented a Redactor field in Ember with valueBinding? I find a bit complicated since Redactor inserts a new element and I have to find a way to add bindings to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment