Simplify drive letter / device conditional

The `drivelist` module includes a new property called `name` in `2.0.7`
that resolves to the drive letter (mount point) on Windows, and to the
drive otherwise.
This commit is contained in:
Juan Cruz Viotti 2016-01-04 00:47:48 -04:00
parent c589165e40
commit 5af3cf3fb9
4 changed files with 3 additions and 18 deletions

View File

@ -72,8 +72,6 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState
console.debug('Drive selected: ' + drive.device); console.debug('Drive selected: ' + drive.device);
}; };
this.platform = window.process.platform;
this.burn = function(image, drive) { this.burn = function(image, drive) {
// Stop scanning drives when burning // Stop scanning drives when burning

View File

@ -71,8 +71,6 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState
console.debug('Drive selected: ' + drive.device); console.debug('Drive selected: ' + drive.device);
}; };
this.platform = window.process.platform;
this.burn = function(image, drive) { this.burn = function(image, drive) {
// Stop scanning drives when burning // Stop scanning drives when burning

View File

@ -54,15 +54,7 @@
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li ng-repeat="drive in app.scanner.drives"> <li ng-repeat="drive in app.scanner.drives">
<a href="#" ng-click="app.selectDrive(drive)"> <a href="#" ng-click="app.selectDrive(drive)" ng-bind="drive.name + ' - ' + drive.size"></a>
<!-- Show drive letter instead of phsycal drive name on Windows -->
<span ng-if="app.platform == 'win32'"
ng-bind="'Drive ' + drive.mountpoint + ' - ' + drive.size"></span>
<span ng-if="app.platform != 'win32'"
ng-bind="drive.device + ' - ' + drive.size"></span>
</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -73,10 +65,7 @@
</div> </div>
</div> </div>
<div ng-show="app.selection.hasDrive()"> <div ng-show="app.selection.hasDrive()" ng-bind="app.selection.getDrive().name"></div>
<span ng-if="app.platform == 'win32'" ng-bind="app.selection.getDrive().mountpoint"></span>
<span ng-if="app.platform != 'win32'" ng-bind="app.selection.getDrive().device"></span>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -25,7 +25,7 @@
"angular-ui-bootstrap": "^0.14.2", "angular-ui-bootstrap": "^0.14.2",
"bluebird": "^3.0.5", "bluebird": "^3.0.5",
"bootstrap-sass": "^3.3.5", "bootstrap-sass": "^3.3.5",
"drivelist": "^2.0.4", "drivelist": "^2.0.7",
"electron-window": "^0.6.0", "electron-window": "^0.6.0",
"flexboxgrid": "^6.3.0", "flexboxgrid": "^6.3.0",
"is-elevated": "^1.0.0", "is-elevated": "^1.0.0",