Sha256: a49a23de9e64946c551a8c0b8e2ededc933e8be50ba63b0621d27487e105c130
Contents?: true
Size: 1.18 KB
Versions: 21
Compression:
Stored size: 1.18 KB
Contents
// Place all the behaviors and hooks related to the matching controller here. // All this logic will automatically be available in application.js. import Core from 'spotlight/core' export default class { connect(){ SirTrevor.setDefaults({ iconUrl: Spotlight.sirTrevorIcon, uploadUrl: $('[data-attachment-endpoint]').data('attachment-endpoint'), ajaxOptions: { headers: { 'X-CSRF-Token': Core.csrfToken() || '' }, credentials: 'same-origin' } }); SirTrevor.Blocks.Heading.prototype.toolbarEnabled = true; SirTrevor.Blocks.Quote.prototype.toolbarEnabled = true; SirTrevor.Blocks.Text.prototype.toolbarEnabled = true; var instance = $('.js-st-instance').first(); if (instance.length) { var editor = new SirTrevor.Editor({ el: instance[0], blockTypes: instance.data('blockTypes'), defaultType:["Text"], onEditorRender: function() { $.SerializedForm(); }, blockTypeLimits: { "SearchResults": 1 } }); editor.blockControls = Core.BlockControls.create(editor); new Core.BlockLimits(editor).enforceLimits(editor); } } }
Version data entries
21 entries across 21 versions & 1 rubygems