Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Rte helpers fallback class (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanPJF authored Sep 27, 2017
1 parent 77a52ee commit b4ba0fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/slate-theme/src/scripts/slate/rte.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ slate.rte = {
* @param {string} options.tableWrapperClass - table wrapper class name
*/
wrapTable: function(options) {
options.$tables.wrap('<div class="' + options.tableWrapperClass + '"></div>');
var tableWrapperClass = typeof options.tableWrapperClass === "undefined" ? '' : options.tableWrapperClass;

options.$tables.wrap('<div class="' + tableWrapperClass + '"></div>');
},

/**
Expand All @@ -26,9 +28,11 @@ slate.rte = {
* @param {string} options.iframeWrapperClass - class name used on the wrapping div
*/
wrapIframe: function(options) {
var iframeWrapperClass = typeof options.iframeWrapperClass === "undefined" ? '' : options.iframeWrapperClass;

options.$iframes.each(function() {
// Add wrapper to make video responsive
$(this).wrap('<div class="' + options.iframeWrapperClass + '"></div>');
$(this).wrap('<div class="' + iframeWrapperClass + '"></div>');

// Re-set the src attribute on each iframe after page load
// for Chrome's "incorrect iFrame content on 'back'" bug.
Expand Down

0 comments on commit b4ba0fe

Please sign in to comment.