Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Fixed up the update handling so changes are properly reflected in the
Browse files Browse the repository at this point in the history
model.
  • Loading branch information
KayEss committed Mar 6, 2012
1 parent f75fcb0 commit 22b6288
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions usr/share/beanbag/wiki/media/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ WikiController.$inject = ['$location', '$http'];
// http://jsfiddle.net/ProLoser/nTzRA/
angular.directive('ui:tinymce', function(expression, config) {
return function(element) {
var callback = function() {
if (this.isDirty()) {
this.save();
element.trigger('change');
}
return true;
};
element.tinymce({
// Location of TinyMCE script
script_url: '/_/tinymce/jscripts/tiny_mce/tiny_mce.js',
Expand All @@ -53,13 +60,8 @@ angular.directive('ui:tinymce', function(expression, config) {
plugins: "inlinepopups",

// Update Textarea and Trigger change event
handle_event_callback: function(e) {
if (this.isDirty()) {
this.save();
element.trigger('change');
}
return true;
}
onchange_callback: callback,
handle_event_callback: callback,
});
};
});

0 comments on commit 22b6288

Please sign in to comment.