Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Fix #158: Custom configuration from scope variable not working #314

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/tinymce.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/tinymce.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ angular.module('ui.tinymce', [])

expression = {};

angular.extend(expression, scope.$eval(attrs.uiTinymce));

//Debounce update and save action
var debouncedUpdate = (function(debouncedUpdateDelay) {
var debouncedUpdateTimer;
Expand Down Expand Up @@ -128,13 +126,17 @@ angular.module('ui.tinymce', [])
format: expression.format || 'html',
selector: '#' + attrs.id
};
// extend options with initial uiTinymceConfig and
// options from directive attribute value
angular.extend(options, uiTinymceConfig, expression, setupOptions);

// Wrapped in $timeout due to $tinymce:refresh implementation, requires
// element to be present in DOM before instantiating editor when
// re-rendering directive
$timeout(function() {
angular.extend(expression, scope.$eval(attrs.uiTinymce));

// extend options with initial uiTinymceConfig and
// options from directive attribute value
angular.extend(options, uiTinymceConfig, expression, setupOptions);

if (options.baseURL){
tinymce.baseURL = options.baseURL;
}
Expand Down