Skip to content

Commit

Permalink
Prevent of loading widgets if querrySelectorAll is undefiend.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed Dec 4, 2017
1 parent 898d326 commit b6a80d5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/widget/plugin.js
Original file line number Diff line number Diff line change
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 b6a80d5

Please sign in to comment.