Permalink
Browse files

Show reference subs based on selection

  • Loading branch information...
1 parent fd9be61 commit 283723e5b169e0121e627706dc7be97c528e8c6c @honza honza committed Dec 31, 2012
@@ -141,7 +141,8 @@
};
};
- HelperSelectorController = function($scope, SubtitleStorage) {
+ HelperSelectorController = function($scope, SubtitleStorage,
+ SubtitleListFinder) {
$scope.getPrimaryAudioLanguage = function(languages) {
return _.find(languages, function(language) {
@@ -160,6 +161,17 @@
SubtitleStorage.getLanguages(function(languages) {
$scope.languages = languages;
});
+
+ $scope.versionChanged = function(newVersion) {
+ if (!newVersion) {
+ return;
+ }
+ var subtitles = newVersion.subtitlesXML;
+ var refSubList = SubtitleListFinder.get('reference-subtitle-set');
+ refSubList.scope.onSubtitlesFetched(subtitles);
+ };
+
+ $scope.$watch('version', $scope.versionChanged);
};
SaveSessionButtonController = function($scope, SubtitleListFinder){
@@ -53,10 +53,9 @@ <h1>[[ heading ]]</h1>
ng-change="languageSelectChanged()"
ng-options="item.name for item in languages">
</select>
- <select name="alternate-version" id="alternate-version">
- <option
- ng-repeat="version in versions"
- value="">[[ version.number ]]</option>
+ <select name="alternate-version" id="alternate-version"
+ ng-options="version.number for version in versions"
+ ng-model="version">
</select>
</div>
<div class="reference-subtitles ng-cloak" ng-cloak ng-controller="SubtitleListController">

0 comments on commit 283723e

Please sign in to comment.