Skip to content

Commit e94e2fb

Browse files
committed
release v0.7.1
1 parent e26fdb7 commit e94e2fb

7 files changed

Lines changed: 44 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 0.7.1 (2016-01-22)
2+
* Fix a bug that load 2 editor on IE(it is a workaround)
3+
[#98](https://github.com/summernote/angular-summernote/issues/98)
4+
* Fix a bug when content is empty
5+
[#105](https://github.com/summernote/angular-summernote/pull/105)
6+
* Support placeholder, min height and max height options
7+
[#97](https://github.com/summernote/angular-summernote/pull/97),
8+
[#104](https://github.com/summernote/angular-summernote/pull/104)
9+
* Supoort on-media-delete callback
10+
[#92](https://github.com/summernote/angular-summernote/issues/92)
11+
112
# 0.7.0 (2015-12-11)
213
* Make compatible with summernote v0.7.0
314

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
***
44

5-
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
65
[![Build Status](https://travis-ci.org/summernote/angular-summernote.png?branch=master)](https://travis-ci.org/summernote/angular-summernote)
76
[![Dependency Status](https://gemnasium.com/summernote/angular-summernote.png)](https://gemnasium.com/summernote/angular-summernote)
87
[![Coverage Status](https://coveralls.io/repos/summernote/angular-summernote/badge.png)](https://coveralls.io/r/summernote/angular-summernote)
@@ -32,7 +31,7 @@ v0.7.2. Angular-summernote will release patch update, such as v0.7.1, if only an
3231

3332
## Demo
3433

35-
See at [JSFiddle](http://jsfiddle.net/outsider/n8dt4/246/embedded/result%2Chtml%2Cjs%2Ccss/)
34+
See at [JSFiddle](http://jsfiddle.net/outsider/n8dt4/271/embedded/result%2Chtml%2Cjs%2Ccss/)
3635
or run example in projects(need to run `bower install` before run)
3736

3837
## Installation

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-summernote",
33
"description": "AngularJS directive to Summernote",
4-
"version": "0.7.0",
4+
"version": "0.7.1",
55
"main": [
66
"./dist/angular-summernote.js"
77
],

dist/angular-summernote.js

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* angular-summernote v0.7.0 | (c) 2014, 2015 JeongHoon Byun | MIT license */
1+
/* angular-summernote v0.7.1 | (c) 2016 JeongHoon Byun | MIT license */
22
/* global angular */
33
angular.module('summernote', [])
44

@@ -8,7 +8,10 @@ angular.module('summernote', [])
88
var currentElement,
99
summernoteConfig = $scope.summernoteConfig || {};
1010

11-
if (angular.isDefined($attrs.height)) { summernoteConfig.height = $attrs.height; }
11+
if (angular.isDefined($attrs.height)) { summernoteConfig.height = +$attrs.height; }
12+
if (angular.isDefined($attrs.minHeight)) { summernoteConfig.minHeight = +$attrs.minHeight; }
13+
if (angular.isDefined($attrs.maxHeight)) { summernoteConfig.maxHeight = +$attrs.maxHeight; }
14+
if (angular.isDefined($attrs.placeholder)) { summernoteConfig.placeholder = $attrs.placeholder; }
1215
if (angular.isDefined($attrs.focus)) { summernoteConfig.focus = true; }
1316
if (angular.isDefined($attrs.airmode)) { summernoteConfig.airMode = true; }
1417
if (angular.isDefined($attrs.lang)) {
@@ -30,6 +33,17 @@ angular.module('summernote', [])
3033
$scope.imageUpload({files:files, editable: $scope.editable});
3134
};
3235
}
36+
if (angular.isDefined($attrs.onMediaDelete)) {
37+
callbacks.onMediaDelete = function(target) {
38+
// make new object that has information of target to avoid error:isecdom
39+
var removedMedia = {attrs: {}};
40+
removedMedia.tagName = target[0].tagName;
41+
angular.forEach(target[0].attributes, function(attr) {
42+
removedMedia.attrs[attr.name] = attr.value;
43+
});
44+
$scope.mediaDelete({target: removedMedia});
45+
}
46+
}
3347

3448
this.activate = function(scope, element, ngModel) {
3549
var updateNgModel = function() {
@@ -43,8 +57,10 @@ angular.module('summernote', [])
4357
};
4458

4559
callbacks.onChange = function(contents) {
46-
if (element.summernote('isEmpty')) { contents = ''; }
47-
updateNgModel();
60+
$timeout(function() {
61+
if (element.summernote('isEmpty')) { contents = ''; }
62+
updateNgModel();
63+
}, 0);
4864
$scope.change({contents:contents, editable: $scope.editable});
4965
};
5066
callbacks.onBlur = function(evt) {
@@ -79,7 +95,11 @@ angular.module('summernote', [])
7995

8096
if (ngModel) {
8197
ngModel.$render = function() {
82-
element.summernote('code', ngModel.$viewValue || '');
98+
if (ngModel.$viewValue) {
99+
element.summernote('code', ngModel.$viewValue);
100+
} else {
101+
element.summernote('empty');
102+
}
83103
};
84104
}
85105

@@ -127,7 +147,8 @@ angular.module('summernote', [])
127147
keyup: '&onKeyup',
128148
keydown: '&onKeydown',
129149
change: '&onChange',
130-
imageUpload: '&onImageUpload'
150+
imageUpload: '&onImageUpload',
151+
mediaDelete: '&onMediaDelete'
131152
},
132153
template: '<div class="summernote"></div>',
133154
link: function(scope, element, attrs, ctrls, transclude) {

dist/angular-summernote.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var gulp = require('gulp'),
99
nugetpack = require('gulp-nuget-pack'),
1010
pkg = require('./package.json');
1111

12-
var banner = '/* angular-summernote v<%=pkg.version%> | (c) 2014, 2015 JeongHoon Byun | MIT license */\n';
12+
var banner = '/* angular-summernote v<%=pkg.version%> | (c) 2016 JeongHoon Byun | MIT license */\n';
1313
var isAngular12 = isAngular13 = false;
1414

1515
gulp.task('lint', function() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-summernote",
33
"description": "AngularJS directive to Summernote",
4-
"version": "0.7.0",
4+
"version": "0.7.1",
55
"author": {
66
"name": "\"Outsider\" Jeonghoon Byun",
77
"email": "outsideris@gmail.com",

0 commit comments

Comments
 (0)