Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
Fix the bug that duplicate items in a list after delete a item
Browse files Browse the repository at this point in the history
  • Loading branch information
mb21 committed Jun 10, 2014
1 parent 9c458e8 commit b5d7898
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion js/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ app.directive('ngModelOnblur', function() {
};
});

// directive to focus an input element
// usage: <input type="text" focus />
//app.directive('focus', function() {
// return {
// restrict: 'A',
// link: function(scope, element, attributes) {
// element[0].focus();
// }
// }
//});

app.directive('json', function($compile, $timeout) {
return {
restrict: 'E',
Expand Down Expand Up @@ -215,7 +226,7 @@ app.directive('json', function($compile, $timeout) {
+ '<div class="jsonContents" ng-hide="collapsed">'
+ '<ol class="arrayOl" ui-multi-sortable ng-model="child">'
// repeat
+ '<li class="arrayItem" ng-repeat="val in child" ng-init="key=$index">' //key needed in moveKey()
+ '<li class="arrayItem" ng-repeat="val in child">'
// delete button
+ '<i class="deleteKeyBtn icon-trash" ng-click="deleteKey(child, $index)"></i>'
+ '<i class="moveArrayItemBtn icon-align-justify"></i>'
Expand Down

0 comments on commit b5d7898

Please sign in to comment.