Skip to content

Commit

Permalink
Fix: Listen textiput event(for IE)
Browse files Browse the repository at this point in the history
  • Loading branch information
st44100 committed Jun 4, 2015
1 parent 230ed4d commit 27d95bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
13 changes: 10 additions & 3 deletions dist/angular-medium-editor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* angular-medium-editor
* @version v0.1.0 - 2015-06-04
* @link https://github.com/thijsw/angular-medium-editor
* @author Thijs Wijnmaalen <[email protected]>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
'use strict';

angular.module('angular-medium-editor', [])
Expand Down Expand Up @@ -58,7 +65,7 @@ angular.module('angular-medium-editor', [])

// view -> model
iElement.on('blur', onChange);
iElement.on('input', onChange);
iElement.on('input textinput', onChange);

// model -> view
ctrl.$render = function() {
Expand All @@ -73,9 +80,9 @@ angular.module('angular-medium-editor', [])
}

iElement.html(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);

// hide placeholder when view is not empty
if(!ctrl.$isEmpty(ctrl.$viewValue)) angular.element(iElement).removeClass('medium-editor-placeholder');
if(!ctrl.$isEmpty(ctrl.$viewValue)) angular.element(iElement).removeClass('medium-editor-placeholder');
};

}
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-medium-editor.min.js

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

6 changes: 3 additions & 3 deletions src/angular-medium-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ angular.module('angular-medium-editor', [])

// view -> model
iElement.on('blur', onChange);
iElement.on('input', onChange);
iElement.on('input textinput', onChange);

// model -> view
ctrl.$render = function() {
Expand All @@ -73,9 +73,9 @@ angular.module('angular-medium-editor', [])
}

iElement.html(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);

// hide placeholder when view is not empty
if(!ctrl.$isEmpty(ctrl.$viewValue)) angular.element(iElement).removeClass('medium-editor-placeholder');
if(!ctrl.$isEmpty(ctrl.$viewValue)) angular.element(iElement).removeClass('medium-editor-placeholder');
};

}
Expand Down

0 comments on commit 27d95bb

Please sign in to comment.