Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Patched a workaround for Uncaught TypeError issue with jQuery and ng-…
Browse files Browse the repository at this point in the history
…repeat on elb listener editor
  • Loading branch information
kyolee310 committed Apr 2, 2015
1 parent 4c7d88f commit 7205dac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</span>
</td>
<td>
<a class="remove" ng-click="removeListener($event, $index)" title="Remove rule"><i class="fi-x"></i></a>
<a class="remove" ng-click="removeListener($index)" title="Remove rule"><i class="fi-x"></i></a>
</td>
</tr>
</tbody>
Expand Down
6 changes: 4 additions & 2 deletions eucaconsole/static/js/widgets/elb_listener_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ angular.module('EucaConsoleUtils').directive('elbListenerEditor', function() {
$scope.$emit('listenerArrayUpdate');
});
};
$scope.removeListener = function ($event, index) {
$event.preventDefault();
$scope.removeListener = function (index) {
// Workaround for the Bug in jQuery to prevent JS Uncaught TypeError
// See http://stackoverflow.com/questions/27408501/ng-repeat-sorting-is-throwing-an-exception-in-jquery
Object.getPrototypeOf(document.createComment('')).getAttribute = function() {};
$scope.listenerArray.splice(index, 1);
$scope.syncListeners();
$scope.$emit('listenerArrayUpdate');
Expand Down

0 comments on commit 7205dac

Please sign in to comment.