0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-21 14:02:28 -05:00

Can't use getElementById in IE very well. Use querySelector instead.

This commit is contained in:
Gert K. Sønderby 2015-10-02 13:29:35 +02:00 committed by Gert Sønderby
parent 5237532d4c
commit bfbdd45184
4 changed files with 8 additions and 8 deletions

View file

@ -3557,8 +3557,8 @@ var makePreformatted = function ( frag ) {
var removePreformatted = function ( frag ) {
var range = this._doc.createRange();
var startRangeMarker = frag.getElementById( startSelectionId );
var endRangeMarker = frag.getElementById( endSelectionId );
var startRangeMarker = frag.querySelector( '#' + startSelectionId );
var endRangeMarker = frag.querySelector( '#' + endSelectionId );
if (!startRangeMarker || !endRangeMarker) { return frag; }
range.setStartBefore( startRangeMarker );

File diff suppressed because one or more lines are too long

View file

@ -1358,8 +1358,8 @@ var makePreformatted = function ( frag ) {
var removePreformatted = function ( frag ) {
var range = this._doc.createRange();
var startRangeMarker = frag.getElementById( startSelectionId );
var endRangeMarker = frag.getElementById( endSelectionId );
var startRangeMarker = frag.querySelector( '#' + startSelectionId );
var endRangeMarker = frag.querySelector( '#' + endSelectionId );
if (!startRangeMarker || !endRangeMarker) { return frag; }
range.setStartBefore( startRangeMarker );

View file

@ -22,7 +22,7 @@ var expect = unexpected.clone()
describe('Squire RTE', function () {
var doc, editor;
beforeEach(function () {
var iframe = document.getElementById('testFrame');
var iframe = document.querySelector('#testFrame');
doc = iframe.contentDocument;
editor = new Squire(doc);
});
@ -272,7 +272,7 @@ describe('Squire RTE', function () {
afterEach(function () {
editor = null;
var iframe = document.getElementById('testFrame');
var iframe = document.querySelector('#testFrame');
iframe.src = 'blank.html';
});
});