Skip to content

Commit

Permalink
Merge pull request eKoopmans#164 from dave-deep/master
Browse files Browse the repository at this point in the history
Fixed issues with references and checks
  • Loading branch information
eKoopmans authored Oct 7, 2018
2 parents a1eee56 + b1f5bf4 commit 97e269e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugin/pagebreaks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Worker from '../worker.js';
import { objType, createElement } from './utils.js';
import { objType, createElement } from '../utils.js';

// Add page-break functionality.

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

// Get arrays of all explicitly requested elements.
var select = {};
var self = this;
['before', 'after', 'avoid'].forEach(function(key) {
var all = mode.avoidAll && key === 'avoid';
select[key] = all ? [] : [].concat(this.opt.pageBreak[key]);
select[key] = all ? [] : (undefined === self.opt.pageBreak[key] ? [] : [].concat(self.opt.pageBreak[key]));
if (select[key].length > 0) {
select[key] = Array.prototype.slice.call(
root.querySelectorAll(select[key].join(', ')));
Expand Down

0 comments on commit 97e269e

Please sign in to comment.