Browse Source

Fixed tests - replaced getElementById with querySelector to avoid "getElementById is not a function" error

pull/988/head
Val Rudi 9 years ago
parent
commit
4d72da01c1
  1. 6
      src/css_composer/view/CssRulesView.js

6
src/css_composer/view/CssRulesView.js

@ -63,13 +63,13 @@ module.exports = require('backbone').View.extend({
}
const mediaWidth = this.getMediaWidth(model.get('mediaText'));
const styleBlockId = `${this.pfx}rules-${mediaWidth}`;
const styleBlockId = `#${this.pfx}rules-${mediaWidth}`;
if (rendered) {
if (fragment) {
fragment.getElementById(styleBlockId).appendChild(rendered);
fragment.querySelector(styleBlockId).appendChild(rendered);
} else {
let $stylesContainer = this.$el.find(`#${styleBlockId}`);
let $stylesContainer = this.$el.find(styleBlockId);
$stylesContainer.append(rendered);
}
}

Loading…
Cancel
Save