activeadmin_medium_editor 0.2.9 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5972e387829d5a8a9d69e3d7761d6128220b9eae93697687608251f41300e0b8
|
4
|
+
data.tar.gz: f58b84df60c453dc47ae03d4c79ee2e7168ed110e2030053b304fe5f4e2aa25a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
2
|
-
|
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
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
16
|
+
// --- events ----------------------------------------------------------------
|
17
|
+
$(document).ready(() => {
|
18
|
+
initMediumEditors()
|
19
|
+
})
|
20
|
+
|
21
|
+
$(document).on('has_many_add:after', '.has_many_container', () => {
|
22
|
+
initMediumEditors()
|
23
|
+
})
|
24
|
+
})()
|
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.
|
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-
|
11
|
+
date: 2020-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|