activeadmin_medium_editor 0.2.9 → 0.2.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d552424d2bffd4166c766a96cadebcf1dd6f718690fde2c8da62777dcc367dc3
4
- data.tar.gz: 5c66ee3bee3e8acfea0d3d65d0957c7a26b2a1e6c1b7082c93246726a398d742
3
+ metadata.gz: 5972e387829d5a8a9d69e3d7761d6128220b9eae93697687608251f41300e0b8
4
+ data.tar.gz: f58b84df60c453dc47ae03d4c79ee2e7168ed110e2030053b304fe5f4e2aa25a
5
5
  SHA512:
6
- metadata.gz: a184a28f68f2165e017d1628ec287c902d77ab67d61162a6572d7560280012ceb18c09191b08bf056bf742f4ee37baa813e909da9238943d610aaa312d512c0e
7
- data.tar.gz: 2ae2e169cec0e803a8ffcee88af9e5bf8478218e65a0f1f58d9b3eb33dbaeee2bdbf145d99b8910a8b67447b371fb3c936ea4f624f251da591a70fb4d713c493
6
+ metadata.gz: eb823327aeb633375011c4065cbb88398ed4873fb84acc9a1be6a0edbb7d6227a481bacbb0cc824100169f926c9a6836cdcd5cc26c9ef80c4a748d2ea13d0481
7
+ data.tar.gz: 4bb94894a97ac6760c24c60b3f2c3409740e81439ff2ffddd21085bcf982432c112c88629d2fe1d9dd66b1ab1baf6bac9cfa17a5533679f500b8bef2e7903120
data/README.md CHANGED
@@ -27,7 +27,7 @@ An Active Admin plugin to use [medium-editor](https://github.com/yabwe/medium-ed
27
27
 
28
28
  > Why 2 separated scripts/styles? In this way you can include a different version of *medium-editor* if you like
29
29
 
30
- > **UPDATE FROM VERSION < 2.8**: please change your _app/assets/stylesheets/active_admin.scss_ using the new import lines above
30
+ > **UPDATE FROM VERSION < 0.2.8**: please change your _app/assets/stylesheets/active_admin.scss_ using the new import lines above
31
31
 
32
32
  ## Examples
33
33
 
@@ -1,18 +1,24 @@
1
- function initMediumEditors() {
2
- $('.medium-editor').each(function () {
3
- if (!$(this).hasClass('medium-editor--active')) {
4
- var options = {};
5
- options = $.extend({}, options, $(this).data('options'));
6
- new MediumEditor($(this), options);
7
- $(this).addClass('medium-editor--active');
8
- }
9
- });
10
- }
1
+ (function () {
2
+ 'use strict'
11
3
 
12
- $(document).on('has_many_add:after', function () {
13
- initMediumEditors();
14
- });
4
+ // --- functions -------------------------------------------------------------
5
+ function initMediumEditors() {
6
+ $('[data-aa-medium-editor]').each(function () {
7
+ if (!$(this).hasClass('medium-editor--active')) {
8
+ let options = {}
9
+ options = $.extend({}, options, $(this).data('options'))
10
+ new MediumEditor($(this), options)
11
+ $(this).addClass('medium-editor--active')
12
+ }
13
+ })
14
+ }
15
15
 
16
- $(document).ready(function () {
17
- initMediumEditors();
18
- });
16
+ // --- events ----------------------------------------------------------------
17
+ $(document).ready(() => {
18
+ initMediumEditors()
19
+ })
20
+
21
+ $(document).on('has_many_add:after', '.has_many_container', () => {
22
+ initMediumEditors()
23
+ })
24
+ })()
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveAdmin
4
4
  module MediumEditor
5
- VERSION = '0.2.9'
5
+ VERSION = '0.2.12'
6
6
  end
7
7
  end
@@ -4,7 +4,7 @@ module Formtastic
4
4
  module Inputs
5
5
  class MediumEditorInput < Formtastic::Inputs::TextInput
6
6
  def input_html_options
7
- super.merge(class: 'medium-editor')
7
+ super.merge('data-aa-medium-editor': '1')
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_medium_editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2020-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin