quilljs2-rails 2.1.1 → 2.1.3

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.
@@ -87,14 +87,17 @@
87
87
  var quill_container = $('.quill_container');
88
88
  if (quill_container.length > 0) {
89
89
  quill_container.each(function (index, object) {
90
- return create_quill_containers(index, object)
90
+ if ($(object).data('quill-initialized')) { return; }
91
+ create_quill_containers(index, object);
92
+ $(object).data('quill-initialized', true);
91
93
  });
92
94
  }
93
95
  }
94
96
  };
95
97
 
96
- $( document ).on('ready page:change turbolinks:load', function() {
97
- if ($('.ql-editor').length <= 0){
98
+ $( document ).on('ready page:change turbolinks:load turbo:load', function() {
99
+ var pending = $('.quill_container').filter(function(){ return !$(this).data('quill-initialized'); });
100
+ if (pending.length > 0){
98
101
  Quilljs.loadDefaults();
99
102
  }
100
103
  });