<a href='' ng-click="new_set()">
[% l('New Attribute Set...') %]</a>
</li>
+ <li ng-if="!cur_attr_set.isnew()">
+ <a href='' ng-click="clone_set(cur_attr_set)">
+ [% l('Clone "[_1]"', '{{cur_attr_set.label()}}') %]</a>
+ </li>
<li class="divider"></li>
<li ng-repeat="set in attr_sets">
<a href='' ng-click="select_set(set)">{{set.label()}}</a>
angular.forEach($scope.attr_sets, function(set) {
console.debug('inspecting attr set ' + set.label());
+ if (!set.label()) return; // skip (new) unnamed sets
+
// find maps that need deleting
angular.forEach(set.attr_maps(), function(oldmap) {
if (!set._local_map[oldmap.attr()]) {
});
}
+ $scope.clone_set = function(source_set) {
+ var set = new egCore.idl.aeas();
+ set.isnew(true);
+ set.attr_maps([]);
+ set._local_map = {};
+
+ // Copy attr info from cloned attr set. No need to create the
+ // maps now, just indicate in the local mapping that attr maps
+ // are pending.
+ angular.forEach(source_set.attr_maps(), function(map) {
+ set._local_map[map.attr()] = true;
+ });
+
+ $scope.select_set(set);
+ $scope.attr_sets.push(set);
+ }
+
load_data();
}])