Skip to content

Commit 97e269e

Browse files
authored
Merge pull request #164 from dave-deep/master
Fixed issues with references and checks
2 parents a1eee56 + b1f5bf4 commit 97e269e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/plugin/pagebreaks.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Worker from '../worker.js';
2-
import { objType, createElement } from './utils.js';
2+
import { objType, createElement } from '../utils.js';
33

44
// Add page-break functionality.
55

@@ -33,9 +33,10 @@ Worker.prototype.toContainer = function toContainer() {
3333

3434
// Get arrays of all explicitly requested elements.
3535
var select = {};
36+
var self = this;
3637
['before', 'after', 'avoid'].forEach(function(key) {
3738
var all = mode.avoidAll && key === 'avoid';
38-
select[key] = all ? [] : [].concat(this.opt.pageBreak[key]);
39+
select[key] = all ? [] : (undefined === self.opt.pageBreak[key] ? [] : [].concat(self.opt.pageBreak[key]));
3940
if (select[key].length > 0) {
4041
select[key] = Array.prototype.slice.call(
4142
root.querySelectorAll(select[key].join(', ')));

0 commit comments

Comments
 (0)