Skip to content

Commit

Permalink
feature: add close-on-select checkbox & functionality to fileModal (#403
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dularion committed Aug 18, 2017
1 parent cd1a3ec commit e676e0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ angular.module('streama').controller('modalFileCtrl', [
$scope.localFilesEnabled = false;
$scope.localFiles = [];
$scope.activeTab = localStorageService.get('activeFileModalTab')|| 'upload';
$scope.closeOnSelect = localStorageService.get('fileModal.closeOnSelect');
if($scope.closeOnSelect == null){$scope.closeOnSelect = true;}

var localFileLastPath = localStorageService.get('localFileLastPath')|| '';
$scope.localDir = localFileLastPath.split('/') || [];
Expand All @@ -15,6 +17,7 @@ angular.module('streama').controller('modalFileCtrl', [
$scope.loadLocalFiles = loadLocalFiles;
$scope.backLocalDirectory = backLocalDirectory;
$scope.openLocalDirectory = openLocalDirectory;
$scope.toggleCloseOnSelect = toggleCloseOnSelect;


$scope.loadLocalFiles(localFileLastPath);
Expand Down Expand Up @@ -77,6 +80,9 @@ angular.module('streama').controller('modalFileCtrl', [
$scope.video.files.push(data);
$scope.video.hasFiles = true;
}
if($scope.closeOnSelect){
$uibModalInstance.dismiss('cancel');
}
}).error(function(data) {
alertify.error(data.message);
});
Expand Down Expand Up @@ -134,4 +140,8 @@ angular.module('streama').controller('modalFileCtrl', [
})
};

function toggleCloseOnSelect() {
localStorageService.set('fileModal.closeOnSelect', $scope.closeOnSelect);
}

}]);
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
</tr>
</table>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="closeOnSelect" ng-click="toggleCloseOnSelect()"> Close Modal on Select
</label>
</div>
</div>
</div>

Expand Down

0 comments on commit e676e0e

Please sign in to comment.