Skip to content

Commit f4fcf7a

Browse files
committed
Bootstrap + Scroller issues l-lin#189
1 parent d9f88c4 commit f4fcf7a

20 files changed

+43
-47
lines changed

demo/withPlugins/overrideBootstrapOptions.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ <h1><i class="fa fa-play"></i>&nbsp;Override Bootstrap options</h1>
4343
var vm = this;
4444
vm.dtOptions = DTOptionsBuilder
4545
.fromSource('data.json')
46+
.withDOM('<\'row\'<\'col-xs-6\'l><\'col-xs-6\'f>r>t<\'row\'<\'col-xs-6\'i><\'col-xs-6\'p>>')
4647
// Add Bootstrap compatibility
4748
.withBootstrap()
4849
.withBootstrapOptions({

demo/withPlugins/overrideBootstrapOptions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ function WithBootstrapOptionsCtrl(DTOptionsBuilder, DTColumnBuilder) {
66
var vm = this;
77
vm.dtOptions = DTOptionsBuilder
88
.fromSource('data.json')
9+
.withDOM('<\'row\'<\'col-xs-6\'l><\'col-xs-6\'f>r>t<\'row\'<\'col-xs-6\'i><\'col-xs-6\'p>>')
910
// Add Bootstrap compatibility
1011
.withBootstrap()
1112
.withBootstrapOptions({

dist/angular-datatables.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ function dtOptionsBuilder() {
252252
*/
253253
withDOM: function(dom) {
254254
this.dom = dom;
255-
this.hasOverrideDom = true;
256255
return this;
257256
}
258257
};

dist/angular-datatables.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/bootstrap/angular-datatables.bootstrap.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function dtBootstrapConfig($provide) {
8787
* @returns {DTOptions} the options
8888
*/
8989
function withBootstrap() {
90-
options.integrateBootstrap = true;
90+
options.hasBootstrap = true;
9191
// Override page button active CSS class
9292
if (angular.isObject(options.oClasses)) {
9393
options.oClasses.sPageButtonActive = 'active';
@@ -123,7 +123,7 @@ function initBootstrapPlugin(DTRendererService, DTBootstrap) {
123123

124124
function preRender(options) {
125125
// Integrate bootstrap (or not)
126-
if (options && options.integrateBootstrap) {
126+
if (options && options.hasBootstrap) {
127127
DTBootstrap.integrate(options);
128128
} else {
129129
DTBootstrap.deIntegrate();
@@ -136,7 +136,7 @@ initBootstrapPlugin.$inject = ['DTRendererService', 'DTBootstrap'];
136136
* Source: https://editor.datatables.net/release/DataTables/extras/Editor/examples/bootstrap.html
137137
*/
138138
/* @ngInject */
139-
function dtBootstrap(DTBootstrapTableTools, DTBootstrapColVis, DTBootstrapDefaultOptions, DTPropertyUtil) {
139+
function dtBootstrap(DTBootstrapTableTools, DTBootstrapColVis, DTBootstrapDefaultOptions, DTPropertyUtil, DT_DEFAULT_OPTIONS) {
140140
var _initialized = false,
141141
_drawCallbackFunctionList = [],
142142
_savedFn = {};
@@ -354,18 +354,8 @@ function dtBootstrap(DTBootstrapTableTools, DTBootstrapColVis, DTBootstrapDefaul
354354
}
355355

356356
function _setDom(options) {
357-
if (!options.hasOverrideDom) {
358-
var dom = DTBootstrapDefaultOptions.getOptions().dom;
359-
if (options.hasColReorder) {
360-
dom = 'R' + dom;
361-
}
362-
if (options.hasColVis) {
363-
dom = 'C' + dom;
364-
}
365-
if (options.hasTableTools) {
366-
dom = 'T' + dom;
367-
}
368-
return dom;
357+
if (!options.dom || options.dom === DT_DEFAULT_OPTIONS.dom) {
358+
return DTBootstrapDefaultOptions.getOptions().dom;
369359
}
370360
return options.dom;
371361
}
@@ -398,7 +388,7 @@ function dtBootstrap(DTBootstrapTableTools, DTBootstrapColVis, DTBootstrapDefaul
398388
}
399389
}
400390
}
401-
dtBootstrap.$inject = ['DTBootstrapTableTools', 'DTBootstrapColVis', 'DTBootstrapDefaultOptions', 'DTPropertyUtil'];
391+
dtBootstrap.$inject = ['DTBootstrapTableTools', 'DTBootstrapColVis', 'DTBootstrapDefaultOptions', 'DTPropertyUtil', 'DT_DEFAULT_OPTIONS'];
402392

403393
'use strict';
404394
angular.module('datatables.bootstrap.options', ['datatables.options', 'datatables.util'])

dist/plugins/bootstrap/angular-datatables.bootstrap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/colreorder/angular-datatables.colreorder.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ function dtColReorderConfig($provide, DT_DEFAULT_OPTIONS) {
4747
function withColReorder() {
4848
var colReorderPrefix = 'R';
4949
options.dom = options.dom ? options.dom : DT_DEFAULT_OPTIONS.dom;
50-
options.dom = colReorderPrefix + options.dom;
50+
if (options.dom.indexOf(colReorderPrefix) === -1) {
51+
options.dom = colReorderPrefix + options.dom;
52+
}
5153
options.hasColReorder = true;
5254
return options;
5355
}

dist/plugins/colreorder/angular-datatables.colreorder.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/colvis/angular-datatables.colvis.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function dtColVisConfig($provide, DT_DEFAULT_OPTIONS) {
4646
function withColVis() {
4747
var colVisPrefix = 'C';
4848
options.dom = options.dom ? options.dom : DT_DEFAULT_OPTIONS.dom;
49-
options.dom = colVisPrefix + options.dom;
49+
if (options.dom.indexOf(colVisPrefix) === -1) {
50+
options.dom = colVisPrefix + options.dom;
51+
}
5052
options.hasColVis = true;
5153
return options;
5254
}

0 commit comments

Comments
 (0)