Skip to content

Commit

Permalink
Merge pull request #46 from bisubus/master
Browse files Browse the repository at this point in the history
jQuery-related fixes - Looks good.  Thanks!
  • Loading branch information
Tyler Garlick committed Jun 16, 2015
2 parents b54a79d + 5a967dc commit 708eaaf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 3 additions & 4 deletions angular-redactor-9.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
},
additionalOptions = attrs.redactor ?
scope.$eval(attrs.redactor) : {},
editor,
$_element = angular.element(element);
editor;

angular.extend(options, redactorOptions, additionalOptions);

Expand All @@ -51,14 +50,14 @@
// put in timeout to avoid $digest collision. call render() to
// set the initial value.
$timeout(function() {
editor = $_element.redactor(options);
editor = element.redactor(options);
ngModel.$render();
});

ngModel.$render = function() {
if(angular.isDefined(editor)) {
$timeout(function() {
$_element.redactor('set', ngModel.$viewValue || '');
element.redactor('set', ngModel.$viewValue || '');
scope.redactorLoaded = true;
});
}
Expand Down
9 changes: 4 additions & 5 deletions angular-redactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
},
additionalOptions = attrs.redactor ?
scope.$eval(attrs.redactor) : {},
editor,
$_element = angular.element(element);
editor;

angular.extend(options, redactorOptions, additionalOptions);

Expand All @@ -52,7 +51,7 @@
// put in timeout to avoid $digest collision. call render() to
// set the initial value.
$timeout(function() {
editor = $_element.redactor(options);
editor = element.redactor(options);
ngModel.$render();
element.on('remove',function(){
element.off('remove');
Expand All @@ -63,8 +62,8 @@
ngModel.$render = function() {
if(angular.isDefined(editor)) {
$timeout(function() {
$_element.redactor('code.set', ngModel.$viewValue || '');
$_element.redactor('placeholder.toggle');
element.redactor('code.set', ngModel.$viewValue || '');
element.redactor('placeholder.toggle');
scope.redactorLoaded = true;
});
}
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"tests"
],
"dependencies": {
"jquery": ">=2.0.0",
"jquery": "^2.0.0 || ^1.9.0",
"angular": ">=1.2.0"
},
"devDependencies": {
Expand Down

0 comments on commit 708eaaf

Please sign in to comment.