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

Commit 01139f7

Browse files
committed
Clean up code style
1 parent 2b3554d commit 01139f7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/tinymce.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
angular.module('ui.tinymce', [])
55
.value('uiTinymceConfig', {})
6-
.directive('uiTinymce', ['uiTinymceConfig', function (uiTinymceConfig) {
6+
.directive('uiTinymce', ['uiTinymceConfig', function ($rootScope, uiTinymceConfig) {
77
uiTinymceConfig = uiTinymceConfig || {};
88
var generatedIds = 0;
99
return {
@@ -13,7 +13,7 @@ angular.module('ui.tinymce', [])
1313
var expression, options, tinyInstance,
1414
updateView = function () {
1515
ngModel.$setViewValue(elm.val());
16-
if (!scope.$root.$$phase) {
16+
if (!$rootScope.$$phase) {
1717
scope.$apply();
1818
}
1919
};
@@ -37,34 +37,34 @@ angular.module('ui.tinymce', [])
3737

3838
options = {
3939
// Update model when calling setContent (such as from the source editor popup)
40-
setup: function (ed) {
40+
setup: function(ed) {
4141
var args;
4242
ed.on('init', function(args) {
4343
ngModel.$render();
4444
ngModel.$setPristine();
4545
});
4646
// Update model on button click
47-
ed.on('ExecCommand', function (e) {
47+
ed.on('ExecCommand', function(e) {
4848
ed.save();
4949
updateView();
5050
});
5151
// Update model on keypress
52-
ed.on('KeyUp', function (e) {
52+
ed.on('KeyUp', function(e) {
5353
ed.save();
5454
updateView();
5555
});
5656
// Update model on change, i.e. copy/pasted text, plugins altering content
57-
ed.on('SetContent', function (e) {
57+
ed.on('SetContent', function(e) {
5858
if (!e.initial && ngModel.$viewValue !== e.content) {
5959
ed.save();
6060
updateView();
6161
}
6262
});
6363
ed.on('blur', function(e) {
64-
elm.blur();
64+
elm.blur();
6565
});
6666
// Update model when an object has been resized (table, image)
67-
ed.on('ObjectResized', function (e) {
67+
ed.on('ObjectResized', function(e) {
6868
ed.save();
6969
updateView();
7070
});
@@ -77,7 +77,7 @@ angular.module('ui.tinymce', [])
7777
};
7878
// extend options with initial uiTinymceConfig and options from directive attribute value
7979
angular.extend(options, uiTinymceConfig, expression);
80-
setTimeout(function () {
80+
setTimeout(function() {
8181
tinymce.init(options);
8282
});
8383

0 commit comments

Comments
 (0)