Skip to content

Commit

Permalink
release v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
outsideris committed Jan 22, 2016
1 parent e26fdb7 commit e94e2fb
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 13 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 0.7.1 (2016-01-22)
* Fix a bug that load 2 editor on IE(it is a workaround)
[#98](https://github.com/summernote/angular-summernote/issues/98)
* Fix a bug when content is empty
[#105](https://github.com/summernote/angular-summernote/pull/105)
* Support placeholder, min height and max height options
[#97](https://github.com/summernote/angular-summernote/pull/97),
[#104](https://github.com/summernote/angular-summernote/pull/104)
* Supoort on-media-delete callback
[#92](https://github.com/summernote/angular-summernote/issues/92)

# 0.7.0 (2015-12-11)
* Make compatible with summernote v0.7.0

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

***

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

## Demo

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

## Installation
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-summernote",
"description": "AngularJS directive to Summernote",
"version": "0.7.0",
"version": "0.7.1",
"main": [
"./dist/angular-summernote.js"
],
Expand Down
33 changes: 27 additions & 6 deletions dist/angular-summernote.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* angular-summernote v0.7.0 | (c) 2014, 2015 JeongHoon Byun | MIT license */
/* angular-summernote v0.7.1 | (c) 2016 JeongHoon Byun | MIT license */
/* global angular */
angular.module('summernote', [])

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

if (angular.isDefined($attrs.height)) { summernoteConfig.height = $attrs.height; }
if (angular.isDefined($attrs.height)) { summernoteConfig.height = +$attrs.height; }
if (angular.isDefined($attrs.minHeight)) { summernoteConfig.minHeight = +$attrs.minHeight; }
if (angular.isDefined($attrs.maxHeight)) { summernoteConfig.maxHeight = +$attrs.maxHeight; }
if (angular.isDefined($attrs.placeholder)) { summernoteConfig.placeholder = $attrs.placeholder; }
if (angular.isDefined($attrs.focus)) { summernoteConfig.focus = true; }
if (angular.isDefined($attrs.airmode)) { summernoteConfig.airMode = true; }
if (angular.isDefined($attrs.lang)) {
Expand All @@ -30,6 +33,17 @@ angular.module('summernote', [])
$scope.imageUpload({files:files, editable: $scope.editable});
};
}
if (angular.isDefined($attrs.onMediaDelete)) {
callbacks.onMediaDelete = function(target) {
// make new object that has information of target to avoid error:isecdom
var removedMedia = {attrs: {}};
removedMedia.tagName = target[0].tagName;
angular.forEach(target[0].attributes, function(attr) {
removedMedia.attrs[attr.name] = attr.value;
});
$scope.mediaDelete({target: removedMedia});
}
}

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

callbacks.onChange = function(contents) {
if (element.summernote('isEmpty')) { contents = ''; }
updateNgModel();
$timeout(function() {
if (element.summernote('isEmpty')) { contents = ''; }
updateNgModel();
}, 0);
$scope.change({contents:contents, editable: $scope.editable});
};
callbacks.onBlur = function(evt) {
Expand Down Expand Up @@ -79,7 +95,11 @@ angular.module('summernote', [])

if (ngModel) {
ngModel.$render = function() {
element.summernote('code', ngModel.$viewValue || '');
if (ngModel.$viewValue) {
element.summernote('code', ngModel.$viewValue);
} else {
element.summernote('empty');
}
};
}

Expand Down Expand Up @@ -127,7 +147,8 @@ angular.module('summernote', [])
keyup: '&onKeyup',
keydown: '&onKeydown',
change: '&onChange',
imageUpload: '&onImageUpload'
imageUpload: '&onImageUpload',
mediaDelete: '&onMediaDelete'
},
template: '<div class="summernote"></div>',
link: function(scope, element, attrs, ctrls, transclude) {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-summernote.min.js

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

2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var gulp = require('gulp'),
nugetpack = require('gulp-nuget-pack'),
pkg = require('./package.json');

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

gulp.task('lint', function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-summernote",
"description": "AngularJS directive to Summernote",
"version": "0.7.0",
"version": "0.7.1",
"author": {
"name": "\"Outsider\" Jeonghoon Byun",
"email": "outsideris@gmail.com",
Expand Down

0 comments on commit e94e2fb

Please sign in to comment.