5 Коммитов
v0.1.2 ... aa2

Автор SHA1 Сообщение Дата
mat@blocknot.es
7eea36b07d Fix snow theme css extention missing 2018-11-09 11:30:50 +01:00
mat@blocknot.es
21806ca9b4 Support for AA 2.0.0.alpha 2018-11-03 18:38:10 +01:00
mat@blocknot.es
1f13f6c65a v0.1.4: PR4 + Quill Editor 1.3.6 2018-11-03 17:45:21 +01:00
Mattia Roccoberton
73ee9e3787 Merge pull request #4 from mylescc/master
Thank you @mylescc
2018-11-03 17:07:30 +01:00
Myles Cowper-Coles
b251a28b13 Making sure quill editor updates with has_many
What:

* adding an event listerner so when people add a 'has_many' relationship
the quill editor is initialized correctly on any fields;

Why:

* If you have a nested has_many attributes in active admin, the form
is not created until you click the 'Add New ObjectName' button. This
triggers a jQuery event called 'has_many_add:after' which you can use to
trigger the re init of the quill editor.
* 9a33a081c9/app/assets/javascripts/active_admin/lib/has_many.es6 (L52)
2018-09-25 14:57:33 +01:00
10 изменённых файлов: 2524 добавлений и 2184 удалений

Просмотреть файл

@@ -15,5 +15,5 @@ Gem::Specification.new do |spec|
spec.files = `git ls-files -z`.split("\x0")
spec.require_paths = ['lib']
spec.add_runtime_dependency 'activeadmin', '~> 1.0'
spec.add_runtime_dependency 'activeadmin', '2.0.0.alpha' # '~> 1.0'
end

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@@ -1,4 +1,12 @@
window.onload = function() {
window.onload = function () {
initQuillEditors();
}
$(document).on('has_many_add:after', function() {
initQuillEditors();
});
var initQuillEditors = function() {
var editors = document.querySelectorAll( '.quill-editor' );
var default_options = {
modules: {
@@ -19,9 +27,11 @@ window.onload = function() {
for( var i = 0; i < editors.length; i++ ) {
var content = editors[i].querySelector( '.quill-editor-content' );
if( content ) {
var isActive = editors[i].classList.contains('quill-editor--active');
if( content && !isActive) {
var options = editors[i].getAttribute( 'data-options' ) ? JSON.parse( editors[i].getAttribute( 'data-options' ) ) : default_options;
editors[i]['_quill-editor'] = new Quill( content, options );
editors[i].classList += ' quill-editor--active';
}
}

Просмотреть файл

@@ -1,4 +1,4 @@
@import 'activeadmin/quill_editor/quill.snow'
@import 'activeadmin/quill_editor/quill.snow.css'
body.active_admin form .quill-editor
display: inline-block

Просмотреть файл

@@ -1,5 +1,5 @@
/*!
* Quill Editor v1.3.3
* Quill Editor v1.3.6
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com

Просмотреть файл

@@ -1,5 +1,5 @@
/*!
* Quill Editor v1.3.3
* Quill Editor v1.3.6
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com

Просмотреть файл

@@ -1,5 +1,5 @@
/*!
* Quill Editor v1.3.3
* Quill Editor v1.3.6
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com

Просмотреть файл

@@ -1,5 +1,5 @@
module ActiveAdmin
module QuillEditor
VERSION = '0.1.2'
VERSION = '0.1.4'
end
end