<div class="col-sm-2"></div>
<div class="col-sm-8">
<label>[% l('Send to') %]</label>
- <input class="form-control" type="text" ng-model="sstr.routing_label"></input>
+ <eg-basic-combo-box list="localStreamNames" on-select="dirtyForm" selected="sstr.routing_label"></eg-basic-combo-box>
</div>
</div>
</div>
}
reload();
+ $scope.localStreamNames = [];
+ egCore.hatch.getItem('eg.serials.stream_names')
+ .then(function(list) {
+ if (list) $scope.localStreamNames = list;
+ });
+
$scope.distStreamGridControls = {
activateItem : function (item) { } // TODO
};
reload();
form.$setPristine();
}
+ function updateLocalStreamNames (new_name) {
+ if (new_name && $scope.localStreamNames.filter(function(x){ return x == new_name}).length == 0) {
+ $scope.localStreamNames.push(new_name);
+ egCore.hatch.setItem('eg.serials.stream_names', $scope.localStreamNames)
+ }
+ }
+
+ $scope.dirtyForm = function () {
+ $scope.ssubform.$dirty = true;
+ }
+
$scope.save_subscriptions = function(form) {
// traverse through structure and set _ischanged
// TODO add more granular dirty input detection
if (!sdist._isnew) sdist._ischanged = true;
angular.forEach(sdist.streams, function(sstr) {
if (!sstr._isnew) sstr._ischanged = true;
+ updateLocalStreamNames(sstr.routing_label);
});
});
});