Skip to content

Commit

Permalink
fix scrollbar when pagination switched on
Browse files Browse the repository at this point in the history
  • Loading branch information
iamisti committed Dec 23, 2015
1 parent ced9684 commit 2dfafb1
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 127 deletions.
4 changes: 4 additions & 0 deletions dist/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
font-size: 12px;
color: #757575;
}
.mdDataTable .mdDataTable-footer .mdDataTable-pagination md-input-container, .mdDataTable tr th .mdDataTable-pagination md-input-container {
margin-top: 0px;
margin-bottom: 0px;
}
.mdDataTable .checkboxCell {
width: 18px;
/*the next cell should not have just 24px padding */
Expand Down
4 changes: 4 additions & 0 deletions dist/md-data-table-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
font-size: 12px;
color: #757575;
}
.mdDataTable .mdDataTable-footer .mdDataTable-pagination md-input-container, .mdDataTable tr th .mdDataTable-pagination md-input-container {
margin-top: 0px;
margin-bottom: 0px;
}
.mdDataTable .checkboxCell {
width: 18px;
/*the next cell should not have just 24px padding */
Expand Down
254 changes: 127 additions & 127 deletions dist/md-data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,94 @@
(function(){
'use strict';

function mdDataTableCellDirective($parse){
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
htmlContent: '@'
},
require: ['^mdDataTable','^mdDataTableRow'],
link: function($scope, element, attrs, ctrl, transclude){
var mdDataTableRowCtrl = ctrl[1];

transclude(function (clone) {
//TODO: rework, figure out something for including html content
if($scope.htmlContent){
mdDataTableRowCtrl.addToRowDataStorage(clone, 'htmlContent');
}else{
//TODO: better idea?
var cellValue = $parse(clone.html().replace('{{', '').replace('}}', ''))($scope.$parent);
mdDataTableRowCtrl.addToRowDataStorage(cellValue);
}
});
}
};
}
mdDataTableCellDirective.$inject = ['$parse'];

angular
.module('mdDataTable')
.directive('mdDataTableCell', mdDataTableCellDirective);
}());
(function(){
'use strict';

function mdDataTableRowDirective(IndexTrackerFactory){
return {
restrict: 'E',
transclude: true,
require: '^mdDataTable',
scope: {
tableRowId: '='
},
controller: ['$scope', function($scope){
var vm = this;

vm.addToRowDataStorage = addToRowDataStorage;
$scope.rowDataStorage = [];

initIndexTrackerServiceAndBindMethods();

function initIndexTrackerServiceAndBindMethods(){
var indexHelperService = IndexTrackerFactory.getInstance();

vm.increaseIndex = _.bind(indexHelperService.increaseIndex, indexHelperService);
vm.getIndex = _.bind(indexHelperService.getIndex, indexHelperService);
}

function addToRowDataStorage(value, contentType){
if(contentType === 'htmlContent'){
$scope.rowDataStorage.push({value: value, type: 'html'});
}else{
$scope.rowDataStorage.push(value);
}
}
}],
link: function($scope, element, attrs, ctrl, transclude){
appendColumns();

ctrl.addRowData($scope.tableRowId, $scope.rowDataStorage);
//ctrl.increaseIndex();

function appendColumns(){
transclude(function (clone) {
element.append(clone);
});
}
}
};
}
mdDataTableRowDirective.$inject = ['IndexTrackerFactory'];

angular
.module('mdDataTable')
.directive('mdDataTableRow', mdDataTableRowDirective);
}());
(function(){
'use strict';

function mdDataTableColumnDirective(){
return {
restrict: 'E',
Expand Down Expand Up @@ -484,6 +572,45 @@
(function(){
'use strict';

function mdDataTableCardFooterDirective(){
return {
restrict: 'E',
templateUrl: '/main/templates/mdDataTableCardFooter.html',
transclude: true,
replace: true,
scope: true,
require: ['^mdDataTable'],
link: function($scope){

}
};
}

angular
.module('mdDataTable')
.directive('mdDataTableCardFooter', mdDataTableCardFooterDirective);
}());
(function(){
'use strict';

function mdDataTableCardHeaderDirective(){
return {
restrict: 'E',
templateUrl: '/main/templates/mdDataTableCardHeader.html',
transclude: true,
replace: true,
scope: true,
require: ['^mdDataTable']
};
}

angular
.module('mdDataTable')
.directive('mdDataTableCardHeader', mdDataTableCardHeaderDirective);
}());
(function(){
'use strict';

function mdDataTableAddAlignClass(ColumnAlignmentHelper){
return {
restrict: 'A',
Expand Down Expand Up @@ -596,131 +723,4 @@
angular
.module('mdDataTable')
.directive('mdDataTableSortHandler', mdDataTableSortHandlerDirective);
}());
(function(){
'use strict';

function mdDataTableCardFooterDirective(){
return {
restrict: 'E',
templateUrl: '/main/templates/mdDataTableCardFooter.html',
transclude: true,
replace: true,
scope: true,
require: ['^mdDataTable'],
link: function($scope){

}
};
}

angular
.module('mdDataTable')
.directive('mdDataTableCardFooter', mdDataTableCardFooterDirective);
}());
(function(){
'use strict';

function mdDataTableCardHeaderDirective(){
return {
restrict: 'E',
templateUrl: '/main/templates/mdDataTableCardHeader.html',
transclude: true,
replace: true,
scope: true,
require: ['^mdDataTable']
};
}

angular
.module('mdDataTable')
.directive('mdDataTableCardHeader', mdDataTableCardHeaderDirective);
}());
(function(){
'use strict';

function mdDataTableCellDirective($parse){
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
htmlContent: '@'
},
require: ['^mdDataTable','^mdDataTableRow'],
link: function($scope, element, attrs, ctrl, transclude){
var mdDataTableRowCtrl = ctrl[1];

transclude(function (clone) {
//TODO: rework, figure out something for including html content
if($scope.htmlContent){
mdDataTableRowCtrl.addToRowDataStorage(clone, 'htmlContent');
}else{
//TODO: better idea?
var cellValue = $parse(clone.html().replace('{{', '').replace('}}', ''))($scope.$parent);
mdDataTableRowCtrl.addToRowDataStorage(cellValue);
}
});
}
};
}
mdDataTableCellDirective.$inject = ['$parse'];

angular
.module('mdDataTable')
.directive('mdDataTableCell', mdDataTableCellDirective);
}());
(function(){
'use strict';

function mdDataTableRowDirective(IndexTrackerFactory){
return {
restrict: 'E',
transclude: true,
require: '^mdDataTable',
scope: {
tableRowId: '='
},
controller: ['$scope', function($scope){
var vm = this;

vm.addToRowDataStorage = addToRowDataStorage;
$scope.rowDataStorage = [];

initIndexTrackerServiceAndBindMethods();

function initIndexTrackerServiceAndBindMethods(){
var indexHelperService = IndexTrackerFactory.getInstance();

vm.increaseIndex = _.bind(indexHelperService.increaseIndex, indexHelperService);
vm.getIndex = _.bind(indexHelperService.getIndex, indexHelperService);
}

function addToRowDataStorage(value, contentType){
if(contentType === 'htmlContent'){
$scope.rowDataStorage.push({value: value, type: 'html'});
}else{
$scope.rowDataStorage.push(value);
}
}
}],
link: function($scope, element, attrs, ctrl, transclude){
appendColumns();

ctrl.addRowData($scope.tableRowId, $scope.rowDataStorage);
//ctrl.increaseIndex();

function appendColumns(){
transclude(function (clone) {
element.append(clone);
});
}
}
};
}
mdDataTableRowDirective.$inject = ['IndexTrackerFactory'];

angular
.module('mdDataTable')
.directive('mdDataTableRow', mdDataTableRowDirective);
}());

0 comments on commit 2dfafb1

Please sign in to comment.