Commit da65afbf2d0df72756f4d1cb4c240f0003a4d757

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'master'

Master

See merge request !9
... ... @@ -3,7 +3,6 @@ angular.module('focaBotoneraFacturador', [])
3 3 templateUrl: 'src/views/botonera-facturador.html',
4 4 controller: 'focaBotoneraFacturadorController',
5 5 bindings: {
6   - botones: '<',
7   - extra: '<'
  6 + botones: '<'
8 7 }
9 8 });
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"