ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-14809 Ambari Admin: Incorrect handling of unsaved changes in Roles section. (atkach)
Date Wed, 27 Jan 2016 13:33:38 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8e15bec8e -> f4edad887


AMBARI-14809 Ambari Admin: Incorrect handling of unsaved changes in Roles section. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f4edad88
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f4edad88
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f4edad88

Branch: refs/heads/trunk
Commit: f4edad887fe5881e3772e3a937cbf87eb9d0c03a
Parents: 8e15bec
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Wed Jan 27 14:13:05 2016 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Wed Jan 27 15:33:28 2016 +0200

----------------------------------------------------------------------
 .../ui/admin-web/app/scripts/directives/editableList.js     | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f4edad88/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/editableList.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/editableList.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/editableList.js
index 4b57edc..694a7bd 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/editableList.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/directives/editableList.js
@@ -111,6 +111,13 @@ angular.module('ambariAdminConsole')
             break;
         }
       });
+
+      $elem.find('.editable-list-container').on('reset', function(event) {
+        $scope.editMode = false;
+        $scope.items = angular.copy($scope.itemsSource);
+        $scope.input = '';
+        event.stopPropagation();
+      });
     },
     controller: ['$scope', '$injector', '$modal', function($scope, $injector, $modal) {
       var $resource = $injector.get($scope.resourceType);
@@ -175,6 +182,8 @@ angular.module('ambariAdminConsole')
 
       $scope.enableEditMode = function(event) {
         if( $scope.editable && !$scope.editMode){
+          //only one editable-list could be in edit mode at once
+          $('.cluster-manage-access-pane div.edit-mode').trigger('reset');
           $scope.editMode = true;
           $scope.focusOnInput();
         }


Mime
View raw message