Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

Commit bd75450

Browse files
committed
Major fixes to callback syncing issues
1 parent e2c3abc commit bd75450

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

angular-redactor-filepicker.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,19 @@ RedactorPlugins.filepicker = function() {
174174
require: 'ngModel',
175175
link: function(scope, element, attrs, ngModel) {
176176

177-
// Expose scope var with loaded state of Redactor
177+
// Expose scope var with loaded state of Redactor
178178
scope.redactorLoaded = false;
179179

180-
var updateModel = function updateModel(value) {
181-
// $timeout to avoid $digest collision
182-
$timeout(function() {
183-
scope.$apply(function() {
184-
ngModel.$setViewValue(value);
185-
});
186-
});
180+
var updateModel = function() {
181+
scope.$apply(ngModel.$setViewValue($_element.redactor('code.get')));
187182
},
188183
options = {
189-
changeCallback: updateModel,
184+
keyupCallback: updateModel,
185+
keydownCallback: updateModel,
186+
execCommandCallback: updateModel,
187+
autosaveCallback: updateModel,
188+
focusCallback: updateModel,
189+
blurCallback: updateModel,
190190
plugins: ['filepicker', 'fullscreen'],
191191
buttons: ['html', 'bold', 'italic', 'deleted', 'outdent', 'indent', 'image', 'file', 'link', 'alignment', 'horizontalrule']
192192
},

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-redactor-filepicker",
33
"main": "angular-redactor-filepicker.js",
4-
"version": "1.8.0",
4+
"version": "2.0.0",
55
"homepage": "https://github.com/UseFedora/angular-redactor",
66
"authors": [
77
"Tyler Garlick <tjgarlick@gmail.com>",

0 commit comments

Comments
 (0)