Skip to content

Commit

Permalink
Fixed issues with references and checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Deep Dave authored and Deep Dave committed Sep 30, 2018
1 parent 02232e9 commit b1f5bf4
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 b1f5bf4

Please sign in to comment.