Skip to content

Commit 4f3bda3

Browse files
author
Eugene Fidelin
committed
Release 0.7.0
1 parent 4bcbef6 commit 4f3bda3

File tree

12 files changed

+129
-79
lines changed

12 files changed

+129
-79
lines changed

CHANGELOG.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Angular-xeditable changelog
22
=============================
33

4+
Version 0.7.0 Mar 24, 2017
5+
6+
----------------------------
7+
[enh #638] Handle empty date values in combodate (ckosloski)
8+
[enh #630] Use new angular-bootstrap attribute directive (B3nCr)
9+
[bug #624] Fix caret positioning when using div as the editable tag (ckosloski)
10+
[bug #623] Correction of the reading of the datepicker-append-to-body attribute (Fredz66)
11+
[bug #622] Fix cancel not cancelling for ngTagsInput (ckosloski)
12+
[enh #619] Added support for name on radiolist (ckosloski)
13+
[bug #613] Fix checkbox alignment issue when no title is used (ckosloski)
14+
[enh #611] Add support for submit on tab for textarea (ckosloski)
15+
[bug #601] Fix issue with multiselect and submit on blur (ckosloski)
16+
[enh #600] Add support for HTML error messages (ckosloski)
17+
[enh #598] Add support for alt-input-formats to bsdate (kglee79)
18+
[bug #596] Fix $sce error in console when running dev tests (ckosloski)
19+
420
Version 0.6.0 Dec 27, 2016
521

622
----------------------------

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-xeditable",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "Edit in place for AngularJS",
55
"author": "https://github.com/vitalets",
66
"license": "MIT",

dist/css/xeditable.min.css

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

dist/js/xeditable.js

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
2-
angular-xeditable - 0.6.0
2+
angular-xeditable - 0.7.0
33
Edit-in-place for angular.js
4-
Build date: 2016-12-27
4+
Build date: 2017-03-24
55
*/
66
/**
77
* Angular-xeditable module
@@ -171,10 +171,11 @@ angular.module('xeditable').directive('editableBsdate', ['editableDirectiveFacto
171171
['eClearText', 'clear-text'],
172172
['eCloseText', 'close-text'],
173173
['eCloseOnDateSelection', 'close-on-date-selection'],
174-
['eDatePickerAppendToBody', 'datepicker-append-to-body'],
174+
['eDatepickerAppendToBody', 'datepicker-append-to-body'],
175175
['eOnOpenFocus', 'on-open-focus'],
176176
['eName', 'name'],
177-
['eDateDisabled', 'date-disabled']
177+
['eDateDisabled', 'date-disabled'],
178+
['eAltInputFormats', 'alt-input-formats']
178179
];
179180

180181
var dateOptionsNames = [
@@ -281,6 +282,7 @@ angular.module('xeditable').directive('editableBsdate', ['editableDirectiveFacto
281282
}
282283
});
283284
}]);
285+
284286
/*
285287
Angular-ui bootstrap editable timepicker
286288
http://angular-ui.github.io/bootstrap/#/timepicker
@@ -289,7 +291,7 @@ angular.module('xeditable').directive('editableBstime', ['editableDirectiveFacto
289291
function(editableDirectiveFactory) {
290292
return editableDirectiveFactory({
291293
directiveName: 'editableBstime',
292-
inputTpl: '<uib-timepicker></uib-timepicker>',
294+
inputTpl: '<div uib-timepicker></div>',
293295
render: function() {
294296
this.parent.render.call(this);
295297

@@ -321,10 +323,11 @@ angular.module('xeditable').directive('editableCheckbox', ['editableDirectiveFac
321323
inputTpl: '<input type="checkbox">',
322324
render: function() {
323325
this.parent.render.call(this);
324-
if(this.attrs.eTitle) {
325-
this.inputEl.wrap('<label></label>');
326+
this.inputEl.wrap('<label></label>');
327+
328+
if (this.attrs.eTitle) {
326329
this.inputEl.parent().append('<span>' + this.attrs.eTitle + '</span>');
327-
}
330+
}
328331
},
329332
autosubmit: function() {
330333
var self = this;
@@ -403,7 +406,9 @@ angular.module('xeditable').directive('editableCombodate', ['editableDirectiveFa
403406

404407
var combodate = editableCombodate.getInstance(this.inputEl, options);
405408
combodate.$widget.find('select').bind('change', function(e) {
406-
self.scope.$data = (new Date(combodate.getValue())).toISOString();
409+
//.replace is so this works in Safari
410+
self.scope.$data = combodate.getValue() ?
411+
(new Date(combodate.getValue().replace(/-/g, "/"))).toISOString() : null;
407412
});
408413
}
409414
});
@@ -471,7 +476,7 @@ Input types: text|password|email|tel|number|url|search|color|date|datetime|datet
471476
var self = this;
472477
self.inputEl.bind('keydown', function(e) {
473478
//submit on tab
474-
if (e.keyCode === 9) {
479+
if (e.keyCode === 9 && self.editorEl.attr('blur') === 'submit') {
475480
self.scope.$apply(function() {
476481
self.scope.$form.$submit();
477482
});
@@ -507,6 +512,7 @@ angular.module('xeditable').directive('editableTagsInput', ['editableDirectiveFa
507512
var dir = editableDirectiveFactory({
508513
directiveName: 'editableTagsInput',
509514
inputTpl: '<tags-input></tags-input>',
515+
useCopy: true,
510516
render: function () {
511517
this.parent.render.call(this);
512518
this.inputEl.append(editableUtils.rename('auto-complete', this.attrs.$autoCompleteElement));
@@ -540,19 +546,24 @@ angular.module('xeditable').directive('editableRadiolist', [
540546
inputTpl: '<span></span>',
541547
render: function() {
542548
this.parent.render.call(this);
543-
var parsed = editableNgOptionsParser(this.attrs.eNgOptions);
544-
var ngChangeHtml = '';
549+
var parsed = editableNgOptionsParser(this.attrs.eNgOptions),
550+
ngChangeHtml = '',
551+
ngNameHtml = '';
545552

546553
if (this.attrs.eNgChange) {
547-
ngChangeHtml = 'ng-change="' + this.attrs.eNgChange + '"';
554+
ngChangeHtml = ' ng-change="' + this.attrs.eNgChange + '"';
548555
}
549-
556+
557+
if (this.attrs.eName) {
558+
ngNameHtml = ' name="' + this.attrs.eName + '"';
559+
}
560+
550561
var html = '<label data-ng-repeat="'+parsed.ngRepeat+'">'+
551562
'<input type="radio" data-ng-disabled="::' +
552563
this.attrs.eNgDisabled +
553564
'" data-ng-model="$parent.$parent.$data" data-ng-value="' + $interpolate.startSymbol() +
554565
'::' + parsed.locals.valueFn + $interpolate.endSymbol() +'"' +
555-
ngChangeHtml + '>'+
566+
ngChangeHtml + ngNameHtml + '>'+
556567
'<span data-ng-bind="::'+parsed.locals.displayFn+'"></span></label>';
557568

558569
this.inputEl.removeAttr('ng-model');
@@ -589,11 +600,14 @@ angular.module('xeditable').directive('editableSelect', ['editableDirectiveFacto
589600
},
590601
autosubmit: function() {
591602
var self = this;
592-
self.inputEl.bind('change', function() {
593-
self.scope.$apply(function() {
594-
self.scope.$form.$submit();
603+
604+
if (!self.attrs.hasOwnProperty("eMultiple")) {
605+
self.inputEl.bind('change', function () {
606+
self.scope.$apply(function () {
607+
self.scope.$form.$submit();
608+
});
595609
});
596-
});
610+
}
597611
}
598612
});
599613
}]);
@@ -620,7 +634,8 @@ angular.module('xeditable').directive('editableTextarea', ['editableDirectiveFac
620634
self.scope.$form.$submit();
621635
});
622636
}
623-
} else if ((e.ctrlKey || e.metaKey) && (e.keyCode === 13)) {
637+
} else if ((e.ctrlKey || e.metaKey) && (e.keyCode === 13) ||
638+
(e.keyCode === 9 && self.editorEl.attr('blur') === 'submit')) {
624639
self.scope.$apply(function() {
625640
self.scope.$form.$submit();
626641
});
@@ -696,8 +711,8 @@ angular.module('xeditable').factory('editableController',
696711
function($q, editableUtils) {
697712

698713
//EditableController function
699-
EditableController.$inject = ['$scope', '$attrs', '$element', '$parse', 'editableThemes', 'editableIcons', 'editableOptions', '$rootScope', '$compile', '$q'];
700-
function EditableController($scope, $attrs, $element, $parse, editableThemes, editableIcons, editableOptions, $rootScope, $compile, $q) {
714+
EditableController.$inject = ['$scope', '$attrs', '$element', '$parse', 'editableThemes', 'editableIcons', 'editableOptions', '$rootScope', '$compile', '$q', '$sce'];
715+
function EditableController($scope, $attrs, $element, $parse, editableThemes, editableIcons, editableOptions, $rootScope, $compile, $q, $sce) {
701716
var valueGetter;
702717

703718
//if control is disabled - it does not participate in waiting process
@@ -1134,7 +1149,7 @@ angular.module('xeditable').factory('editableController',
11341149

11351150
self.setError = function(msg) {
11361151
if(!angular.isObject(msg)) {
1137-
$scope.$error = msg;
1152+
$scope.$error = $sce.trustAsHtml(msg);
11381153
self.error = msg;
11391154
}
11401155
};
@@ -1539,10 +1554,12 @@ angular.module('xeditable').factory('editableFormController',
15391554
//by default activate first field
15401555
selectionStart = this.$editables[0].elem[0].selectionStart ?
15411556
this.$editables[0].elem[0].selectionStart :
1542-
this.$editables[0].elem[0].text ? this.$editables[0].elem[0].text.length : 0;
1557+
this.$editables[0].elem[0].text ? this.$editables[0].elem[0].text.length :
1558+
this.$editables[0].elem[0].innerHTML ? this.$editables[0].elem[0].innerHTML.length : 0;
15431559
selectionEnd = this.$editables[0].elem[0].selectionEnd ?
15441560
this.$editables[0].elem[0].selectionEnd :
1545-
this.$editables[0].elem[0].text ? this.$editables[0].elem[0].text.length : 0;
1561+
this.$editables[0].elem[0].text ? this.$editables[0].elem[0].text.length :
1562+
this.$editables[0].elem[0].innerHTML ? this.$editables[0].elem[0].innerHTML.length : 0;
15461563
this.$editables[0].activate(selectionStart, selectionEnd);
15471564
}
15481565
},
@@ -2562,7 +2579,7 @@ angular.module('xeditable').factory('editableThemes', function() {
25622579
noformTpl: '<span class="editable-wrap"></span>',
25632580
controlsTpl: '<span class="editable-controls"></span>',
25642581
inputTpl: '',
2565-
errorTpl: '<div class="editable-error" data-ng-if="$error" data-ng-bind="$error"></div>',
2582+
errorTpl: '<div class="editable-error" data-ng-if="$error" data-ng-bind-html="$error"></div>',
25662583
buttonsTpl: '<span class="editable-buttons"></span>',
25672584
submitTpl: '<button type="submit">save</button>',
25682585
cancelTpl: '<button type="button" ng-click="$form.$cancel()">cancel</button>',
@@ -2575,7 +2592,7 @@ angular.module('xeditable').factory('editableThemes', function() {
25752592
noformTpl: '<span class="editable-wrap"></span>',
25762593
controlsTpl: '<div class="editable-controls controls control-group" ng-class="{\'error\': $error}"></div>',
25772594
inputTpl: '',
2578-
errorTpl: '<div class="editable-error help-block" data-ng-if="$error" data-ng-bind="$error"></div>',
2595+
errorTpl: '<div class="editable-error help-block" data-ng-if="$error" data-ng-bind-html="$error"></div>',
25792596
buttonsTpl: '<span class="editable-buttons"></span>',
25802597
submitTpl: '<button type="submit" class="btn btn-primary"><span></span></button>',
25812598
cancelTpl: '<button type="button" class="btn" ng-click="$form.$cancel()">'+
@@ -2591,7 +2608,7 @@ angular.module('xeditable').factory('editableThemes', function() {
25912608
noformTpl: '<span class="editable-wrap"></span>',
25922609
controlsTpl: '<div class="editable-controls form-group" ng-class="{\'has-error\': $error}"></div>',
25932610
inputTpl: '',
2594-
errorTpl: '<div class="editable-error help-block" data-ng-if="$error" data-ng-bind="$error"></div>',
2611+
errorTpl: '<div class="editable-error help-block" data-ng-if="$error" data-ng-bind-html="$error"></div>',
25952612
buttonsTpl: '<span class="editable-buttons"></span>',
25962613
submitTpl: '<button type="submit" class="btn btn-primary"><span></span></button>',
25972614
cancelTpl: '<button type="button" class="btn btn-default" ng-click="$form.$cancel()">'+
@@ -2650,7 +2667,7 @@ angular.module('xeditable').factory('editableThemes', function() {
26502667
noformTpl: '<span class="editable-wrap"></span>',
26512668
controlsTpl: '<div class="editable-controls ui fluid input" ng-class="{\'error\': $error}"></div>',
26522669
inputTpl: '',
2653-
errorTpl: '<div class="editable-error ui error message" data-ng-if="$error" data-ng-bind="$error"></div>',
2670+
errorTpl: '<div class="editable-error ui error message" data-ng-if="$error" data-ng-bind-html="$error"></div>',
26542671
buttonsTpl: '<span class="mini ui buttons"></span>',
26552672
submitTpl: '<button type="submit" class="ui primary button"><i class="ui check icon"></i></button>',
26562673
cancelTpl: '<button type="button" class="ui button" ng-click="$form.$cancel()">'+

dist/js/xeditable.min.js

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

index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<link href="docs/css/docs.css" rel="stylesheet" media="screen">
1818
<!--angular-->
1919
<script src="bower_components/angular/angular.js"></script>
20-
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
2120
<script src="bower_components/angular-mocks/angular-mocks.js"></script>
21+
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
2222
<!--jquery (needed for bootstrap)-->
2323
<script src="bower_components/jquery/dist/jquery.js"></script>
2424
<!--bootstrap-->
@@ -38,7 +38,7 @@
3838
<!--app-->
3939
<script src="docs/js/app.js"></script>
4040
<!--xeditable-->
41-
<script src="dist/js/xeditable.js"></script>
41+
<script src="dist/js/xeditable.min.js"></script>
4242
</head>
4343
<body data-spy="scroll" data-target=".sidebar">
4444
<nav role="navigation" class="navbar navbar-default navbar-fixed-top">
@@ -51,7 +51,7 @@
5151
<li class="active"><a href="#">Home</a></li>
5252
<li><a href="https://github.com/vitalets/angular-xeditable">GitHub</a></li>
5353
</ul>
54-
<form class="navbar-form navbar-right"><a href="zip/angular-xeditable-0.6.0.zip" style="font-weight:bold" class="btn btn-primary"><span style="margin-right:10px" class="glyphicon glyphicon-save"></span>Download 0.6.0 ~ kb</a></form>
54+
<form class="navbar-form navbar-right"><a href="zip/angular-xeditable-0.7.0.zip" style="font-weight:bold" class="btn btn-primary"><span style="margin-right:10px" class="glyphicon glyphicon-save"></span>Download 0.7.0 ~ kb</a></form>
5555
<div style="padding-top: 13px">
5656
<!-- google+ -->
5757
<div id="socials" style="text-align: center">
@@ -196,7 +196,7 @@ <h4>Controls & Features</h4>
196196
<li><a href="#html5-inputs">html5 inputs</a> </li>
197197
<li><a href="#typeahead">typeahead</a></li>
198198
<li><a href="#uiselect">ui-select</a></li>
199-
<li><a href="#ngTagsInput">ngTagsInput</a></li>
199+
<li><a href="#ngtags">ngTagsInput</a></li>
200200
</ul>
201201

202202
</td>
@@ -221,7 +221,7 @@ <h1>Get started</h1>
221221

222222
<pre class="prettyprint">&lt;link href=&quot;https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;</pre>
223223
</li>
224-
<li> <span>Install angular-xeditable via </span><a href="http://bower.io" target="_blank">bower</a><span> or </span><a href="zip/angular-xeditable-0.6.0.zip">download latest zip </a>
224+
<li> <span>Install angular-xeditable via </span><a href="http://bower.io" target="_blank">bower</a><span> or </span><a href="zip/angular-xeditable-0.7.0.zip">download latest zip </a>
225225
<pre class="prettyprint">bower install angular-xeditable </pre>
226226
</li>
227227
<li>Include angular-xeditable into your project
@@ -1038,7 +1038,7 @@ <h1>ngTagsInput</h1>
10381038
<h3>demo</h3>
10391039
<div class="well line-example"><div ng-controller="NgTagsCtrl">
10401040
<form data-editable-form name="ngTagsForm">
1041-
<div editable-tags-input="user.tags" data-e-form="ngTagsForm" data-e-name="tags" name="tags" data-e-ng-model="user.tags">
1041+
<div editable-tags-input="user.tags" data-e-form="ngTagsForm" data-e-name="tags" name="tags" id="tags" data-e-ng-model="user.tags">
10421042
{{user.tags}}
10431043
<editable-tags-input-auto-complete source="loadTags($query)"></editable-tags-input-auto-complete>
10441044
</div>
@@ -1089,7 +1089,7 @@ <h3>demo</h3>
10891089
<h3>html</h3>
10901090
<pre class="prettyprint ng-non-bindable">&lt;div ng-controller=&quot;NgTagsCtrl&quot;&gt;
10911091
&lt;form data-editable-form name=&quot;ngTagsForm&quot;&gt;
1092-
&lt;div editable-tags-input=&quot;user.tags&quot; data-e-form=&quot;ngTagsForm&quot; data-e-name=&quot;tags&quot; name=&quot;tags&quot; data-e-ng-model=&quot;user.tags&quot;&gt;
1092+
&lt;div editable-tags-input=&quot;user.tags&quot; data-e-form=&quot;ngTagsForm&quot; data-e-name=&quot;tags&quot; name=&quot;tags&quot; id=&quot;tags&quot; data-e-ng-model=&quot;user.tags&quot;&gt;
10931093
{{user.tags}}
10941094
&lt;editable-tags-input-auto-complete source=&quot;loadTags($query)&quot;&gt;&lt;/editable-tags-input-auto-complete&gt;
10951095
&lt;/div&gt;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-xeditable",
33
"description": "Edit-in-place for angular.js",
4-
"version": "0.6.0",
4+
"version": "0.7.0",
55
"homepage": "https://vitalets.github.io/angular-xeditable",
66
"author": {
77
"name": "Vitaliy Potapov",

0 commit comments

Comments
 (0)