Commit da65afbf2d0df72756f4d1cb4c240f0003a4d757
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master See merge request !9
Showing
3 changed files
 
Show diff stats
src/js/app.js
src/js/controller.js
| 1 | 1 | angular.module('focaBotoneraFacturador') | 
| 2 | 2 | .controller('focaBotoneraFacturadorController', [ | 
| 3 | 3 | '$scope', | 
| 4 | - function($scope) { | |
| 4 | + '$window', | |
| 5 | + function($scope, $window) { | |
| 5 | 6 | this.$onInit = function() { | 
| 6 | 7 | $scope.botones = $scope.$ctrl.botones; | 
| 7 | 8 | |
| 8 | - for(var i = 0; i < $scope.$ctrl.extra; i++) { | |
| 9 | - $scope.botones.push(''); | |
| 9 | + if($window.innerWidth > 576) { | |
| 10 | + while(($scope.botones.length % 12) !== 0) { | |
| 11 | + $scope.botones.push(''); | |
| 12 | + } | |
| 13 | + }else { | |
| 14 | + while(($scope.botones.length % 3) !== 0) { | |
| 15 | + $scope.botones.push(''); | |
| 16 | + } | |
| 10 | 17 | } | 
| 11 | 18 | }; | 
| 12 | 19 | 
src/views/botonera-facturador.html
| 1 | 1 | <div | 
| 2 | 2 | class="col-3 col-sm-2 px-1 py-1 m-auto m-md-0" | 
| 3 | 3 | ng-repeat="boton in botones track by $index" | 
| 4 | - ng-class="{'d-none d-md-grid': boton == ''}"> | |
| 4 | + ng-class="{'d-md-grid': boton == ''}"> | |
| 5 | 5 | <button | 
| 6 | 6 | type="button" | 
| 7 | 7 | class="btn btn-default btn-block btn-xs text-center py-1 rounded border border-light foca-overflow-hidden" |