Skip to content

Commit

Permalink
Merge pull request #1320 from ckeditor/t/1319
Browse files Browse the repository at this point in the history
Prevent of loading widgets if querySelectorAll is undefined
  • Loading branch information
Comandeer committed Dec 4, 2017
2 parents 898d326 + b6a80d5 commit 230f715
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/widget/plugin.js
Expand Up @@ -18,6 +18,10 @@
// jscs:enable maximumLineLength
requires: 'lineutils,clipboard,widgetselection',
onLoad: function() {
// Widgets require querySelectorAll for proper work (#1319).
if ( CKEDITOR.document.$.querySelectorAll === undefined ) {
return;
}
CKEDITOR.addCss(
'.cke_widget_wrapper{' +
'position:relative;' +
Expand Down Expand Up @@ -85,6 +89,10 @@
},

beforeInit: function( editor ) {
// Widgets require querySelectorAll for proper work (#1319).
if ( CKEDITOR.document.$.querySelectorAll === undefined ) {
return;
}
/**
* An instance of widget repository. It contains all
* {@link CKEDITOR.plugins.widget.repository#registered registered widget definitions} and
Expand All @@ -105,6 +113,10 @@
},

afterInit: function( editor ) {
// Widgets require querySelectorAll for proper work (#1319).
if ( CKEDITOR.document.$.querySelectorAll === undefined ) {
return;
}
addWidgetButtons( editor );
setupContextMenu( editor );
}
Expand Down

0 comments on commit 230f715

Please sign in to comment.