activeadmin_trumbowyg 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: a1a91f93de63ecc7087cf39273727a8df63fab46
4
- data.tar.gz: af2806cf0028a6f186b2886f66b8f910789e5088
3
+ metadata.gz: 43f44b88c4c54b135d7fd8db9c4c182ee546bc84
4
+ data.tar.gz: cede02e50e61095d4b6f1f2736d7acab50417a39
5
5
  SHA512:
6
- metadata.gz: fb46a673a939454f643b33fcf40fbde101d240f4217b0e139493323cfd72383d1d7bb9deb0aad186af9224ea35f209185b74d1be51a9c31cfa631cefe3532ba1
7
- data.tar.gz: 61c445d57add804b7f362e1d0d9b01ed6aeca8388a2031a0a137180b56600bd37ce128163a3985a68c2b8cb67bccf892fa548a4bc05cd1b222e7b3eb14f26b8d
6
+ metadata.gz: 2bd1d65f8b96e2b1fa440c6800a7a9bfad78a124fa12b814dcf839282b72171f5e961b728d837622b674011de5bd1a4a6998af889fef141b1c57b58f6fac5c1b
7
+ data.tar.gz: 7a850e6e617bfb07b071f1316ef3c38a000e12fd9659dfd62a4441fc2794cf6dce8354f978ae4913eb094d7f654e674261eed55a65cec8c37d734f1e9ddd5a58
@@ -1,9 +1,20 @@
1
- $(document).ready( function() {
1
+ function initTrumbowygEditors () {
2
2
  $('.trumbowyg-textarea').each(function () {
3
- var options = {
4
- svgPath: '/assets/active_admin-trumbowyg.svg'
5
- };
6
- options = $.extend({}, options, $(this).data( 'options' ));
7
- $(this).trumbowyg( options );
3
+ if (!$(this).hasClass('trumbowyg-textarea--active')) {
4
+ var options = {
5
+ svgPath: '/assets/active_admin-trumbowyg.svg'
6
+ };
7
+ options = $.extend({}, options, $(this).data('options'));
8
+ $(this).trumbowyg(options);
9
+ $(this).addClass('trumbowyg-textarea--active');
10
+ }
8
11
  });
12
+ }
13
+
14
+ $(document).on('has_many_add:after', function () {
15
+ initTrumbowygEditors();
16
+ });
17
+
18
+ $(document).ready( function() {
19
+ initTrumbowygEditors();
9
20
  });
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module Trumbowyg
3
- VERSION = '0.1.6'
3
+ VERSION = '0.1.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_trumbowyg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-03 00:00:00.000000000 Z
11
+ date: 2018-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin