effective_bootstrap 1.24.0 → 1.26.0

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: f683af3488f235baae5f7eee5f403ade629da5b32763d0ab4c9c80f02cdf6112
4
- data.tar.gz: 9750a978f0fac5b8f4992fd7cf8393092f3eee6dbf36c8e12d24157ca955696f
3
+ metadata.gz: 3dd9a4357bc0f8fab5f5fe15dde1a0613a7601e7cf168050f3e663f3aaf6a401
4
+ data.tar.gz: 257ab417f92c6315cb67e3daa4492d044691984ade2e4e13138eba01b062685c
5
5
  SHA512:
6
- metadata.gz: 52baeedf313df51b034f5f250ea1fbe637cd81525808473ec4cb515dff29f5545a28a44da823b2f6f1f0555fa9180bcee0064fc5bbd31d10981a5519eefa4bdf
7
- data.tar.gz: bc935d0336edc537416f74e2d9361d1373c1d346fd69b4f2ba00e1ade6504605a66d41b5a1a9eae91fa8c3867af50b00fd11519efd972dcc536b51381293ec0d
6
+ metadata.gz: 4fe20521233794d095bf9c4db33471c7e3656a805831b929d8bf44669b33b05aadaadf800e7911282fd67ec5e318e1323e1ed733c971aa2faf3845642145260c
7
+ data.tar.gz: db80dd2bcb4239a6bbb612b05c18ad460a6acb5b96b40775ec206312074ba078607cbb983863aa788c796e38c3ef0aca284f24827a19c239454a01ec1261ece2
@@ -97,3 +97,13 @@ insertUploadByDrop = (response, e) ->
97
97
 
98
98
  editor = ArticleEditor($element, options)
99
99
  editor.app.image.insertByDrop = insertUploadByDrop
100
+
101
+ $(document).on 'turbolinks:before-cache turbo:before-cache', ->
102
+ $('textarea.effective_article_editor.initialized').each (i, element) ->
103
+ $element = $(element)
104
+ editor = ArticleEditor($element)
105
+
106
+ # Preserve unsynced edits, including edits in source mode, before destroying the iframe.
107
+ $element.val(editor.editor.getContent())
108
+ editor.destroy()
109
+ $element.removeClass('initialized')
@@ -17,7 +17,7 @@ this.EffectiveBootstrap ||= new class
17
17
  $element.addClass('initialized')
18
18
 
19
19
  $ -> EffectiveBootstrap.initialize()
20
- $(document).on 'turbolinks:load', -> EffectiveBootstrap.initialize()
20
+ $(document).on 'turbolinks:load turbo:load', -> EffectiveBootstrap.initialize()
21
21
  $(document).on 'cocoon:after-insert', -> EffectiveBootstrap.initialize()
22
22
  $(document).on 'effective-bootstrap:initialize', (event) -> EffectiveBootstrap.initialize(event.currentTarget)
23
23
 
@@ -4,7 +4,7 @@ $(document).on('show.bs.tab', function (e) {
4
4
  });
5
5
 
6
6
  // Display the tab based on form errors, the document hash, or ?tab= params
7
- $(document).ready(function() {
7
+ function initializeEffectiveTabs() {
8
8
  var href = '';
9
9
 
10
10
  var $tab_with_error = $(".form-control.is-invalid").first().closest('.tab-pane')
@@ -28,7 +28,10 @@ $(document).ready(function() {
28
28
 
29
29
  $tab.tab('show')
30
30
  }
31
- });
31
+ }
32
+
33
+ $(initializeEffectiveTabs);
34
+ $(document).on('turbolinks:load turbo:load', initializeEffectiveTabs);
32
35
 
33
36
 
34
37
  // Click tab button
@@ -15,4 +15,5 @@ initialize = ->
15
15
  $buttons.addClass('initialized')
16
16
 
17
17
  $ -> initialize()
18
- $(document).on 'turbolinks:load', -> initialize()
18
+ $(document).on 'turbolinks:load turbo:load', -> initialize()
19
+ $(document).on 'turbolinks:before-cache turbo:before-cache', -> $('.btn-clipboard-copy.initialized').removeClass('initialized')
@@ -1,5 +1,5 @@
1
1
  //= require ../moment/moment
2
2
  //= require ../effective_datetime/bootstrap-datetimepicker
3
3
  //= require ../effective_datetime/overrides
4
- //= require ../effective_datetime/turbolinks
4
+ //= require ../effective_datetime/navigation
5
5
  //= require ./initialize
@@ -1,5 +1,5 @@
1
1
  //= require ../moment/moment
2
2
  //= require ./bootstrap-datetimepicker
3
3
  //= require ./overrides
4
- //= require ./turbolinks
4
+ //= require ./navigation
5
5
  //= require ./initialize
@@ -1,4 +1,4 @@
1
- $(document).on 'turbolinks:before-cache', ->
1
+ $(document).on 'turbolinks:before-cache turbo:before-cache', ->
2
2
  $('input.initialized.effective_date_time_picker').each (i, element) ->
3
3
  $input = $(element)
4
4
  $input.datetimepicker('destroy') if $input.data('datetimepicker')
@@ -62,7 +62,7 @@ effectiveMatch = (params, data) ->
62
62
  $select.data('select2').$container.addClass(options['containerClass']) if options['containerClass']
63
63
  $select.data('select2').$dropdown.addClass(options['dropdownClass']) if options['dropdownClass']
64
64
 
65
- $(document).on 'turbolinks:before-cache', ->
65
+ $(document).on 'turbolinks:before-cache turbo:before-cache', ->
66
66
  $('select.effective_select.initialized').each (i, element) ->
67
67
  $input = $(element)
68
68
  $input.select2('destroy') if $input.data('select2')
@@ -1,5 +1,5 @@
1
1
  //= require ../moment/moment
2
2
  //= require ../effective_datetime/bootstrap-datetimepicker
3
3
  //= require ../effective_datetime/overrides
4
- //= require ../effective_datetime/turbolinks
4
+ //= require ../effective_datetime/navigation
5
5
  //= require ./initialize
@@ -19,6 +19,7 @@ module EffectiveFormBuilderHelper
19
19
  end
20
20
 
21
21
  options[:html] = (options[:html] || {}).merge(novalidate: true, onsubmit: 'return EffectiveForm.validate(this)')
22
+ options[:html]['data-turbo'] = false
22
23
  options[:local] = true unless options.key?(:local)
23
24
 
24
25
  if respond_to?(:inline_datatable?) && inline_datatable?
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '1.24.0'.freeze
2
+ VERSION = '1.26.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.24.0
4
+ version: 1.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
@@ -459,8 +459,8 @@ files:
459
459
  - app/assets/javascripts/effective_datetime/bootstrap-datetimepicker.js
460
460
  - app/assets/javascripts/effective_datetime/initialize.js.coffee
461
461
  - app/assets/javascripts/effective_datetime/input.js
462
+ - app/assets/javascripts/effective_datetime/navigation.js.coffee
462
463
  - app/assets/javascripts/effective_datetime/overrides.js.coffee
463
- - app/assets/javascripts/effective_datetime/turbolinks.js.coffee
464
464
  - app/assets/javascripts/effective_editor/image-drop-and-paste.js
465
465
  - app/assets/javascripts/effective_editor/image-resize.js
466
466
  - app/assets/javascripts/effective_editor/initialize.js.coffee