ack_rails_admin_settings 1.2.3.1 → 1.2.3.2

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: 170c0180099053434000739ccfc73cf787d70743
4
- data.tar.gz: 1a79977ed053c14b6277fcd014c0b8c3ab9961ce
3
+ metadata.gz: 7475254aec1be5faacfa836cb045f377cd5ed001
4
+ data.tar.gz: fca4672f725d0e6d08e7304f8bfd03f2e40c7f49
5
5
  SHA512:
6
- metadata.gz: ef04465917ba01e60c793330a680d62e6f8a36ff2539cdda5fcdd7975db895fba988eadbd6e304efbfce3f45a06d554a2c98fb26be9e90a1f536da307ff3f8eb
7
- data.tar.gz: 9ce97a6dc48ec9a8d2644f17b773dd21ceaeecdbe5b616d318d433e625c9a80ed3e87d10111c4edb8dff74b58ad9d64d9a015de78164208c187d92cf161b04e4
6
+ metadata.gz: 093f8d1fd239916b4d205d0985181f7efdaa4e1f36a7b884172f64d6ba392b294b612b95851fe83a343c507c70a7498fa085e5e960a45487f4ef3769282ed496
7
+ data.tar.gz: 2e63f9930bb6d269166c38bf94648511987f235c4553e261ea74310d23e511943d5fedfc28bd6a2a7481194f159e0c1295b83fb9999062621065ea1326b86672
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ack_rails_admin_settings (1.2.3.1)
4
+ ack_rails_admin_settings (1.2.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,43 +1,48 @@
1
- $(document).on "click", "#edit_rails_admin_settings_setting .raw_array_field .rails_admin_settings_array_element_add_link", (e)->
2
- e.preventDefault()
3
- link = $(e.currentTarget)
4
- link_parent = link.parent()
5
- link_parent.before(link.data('template'))
6
- link_parent.prev().find('input:first').focus().select().trigger('change')
7
- return false
8
-
9
-
10
- $(document).on 'click', '#edit_rails_admin_settings_setting .raw_array_field .rails_admin_settings_array_element_delete_link', (e)->
11
- e.preventDefault()
12
- hidden_field = $(e.currentTarget).closest(".raw_array_field").find("[type='hidden']")
13
- $(e.currentTarget).parent().remove()
14
- hidden_field.trigger('change')
15
- return false
16
-
17
-
18
- $(document).on 'click', '#edit_rails_admin_settings_setting .raw_array_field .rails_admin_settings_array_element_move_link', (e)->
19
- e.preventDefault()
20
- link = $(e.currentTarget)
21
- array_element_block = link.parent()
22
- if link.hasClass("up")
23
- prev = array_element_block.prev(".rails_admin_settings_array_element_block")
24
- array_element_block.insertBefore(prev) if prev.length > 0
25
- if link.hasClass("down")
26
- next = array_element_block.next(".rails_admin_settings_array_element_block")
27
- array_element_block.insertAfter(next) if next.length > 0
28
- return false
29
-
30
-
31
-
32
- $(document).on "change", "#edit_rails_admin_settings_setting .raw_array_field :input", (e)->
33
- field_block = $(e.currentTarget).closest(".raw_array_field")
34
- hidden_field = field_block.find("[type='hidden']")
35
- if field_block.find(":input:not([type='hidden'])").serializeArray().length == 0
36
- hidden_field.prop('name', hidden_field.data('name')) if hidden_field.data('name')
37
- else
38
- hidden_field.data('name', hidden_field.prop('name')) if hidden_field.prop('name')
39
- hidden_field.prop('name', '')
40
-
41
-
42
- $(document).on "rails_admin.dom_ready", (e)->
43
- $("#edit_rails_admin_settings_setting .raw_array_field").find(":input[type='hidden']").trigger('change')
1
+ if !window.rails_admin_settings or !window.rails_admin_settings.array_loaded
2
+ $(document).on "click", "#edit_rails_admin_settings_setting .raw_array_field .rails_admin_settings_array_element_add_link", (e)->
3
+ e.preventDefault()
4
+ link = $(e.currentTarget)
5
+ link_parent = link.parent()
6
+ link_parent.before(link.data('template'))
7
+ link_parent.prev().find('input:first').focus().select().trigger('change')
8
+ return false
9
+
10
+
11
+ $(document).on 'click', '#edit_rails_admin_settings_setting .raw_array_field .rails_admin_settings_array_element_delete_link', (e)->
12
+ e.preventDefault()
13
+ hidden_field = $(e.currentTarget).closest(".raw_array_field").find("[type='hidden']")
14
+ $(e.currentTarget).parent().remove()
15
+ hidden_field.trigger('change')
16
+ return false
17
+
18
+
19
+ $(document).on 'click', '#edit_rails_admin_settings_setting .raw_array_field .rails_admin_settings_array_element_move_link', (e)->
20
+ e.preventDefault()
21
+ link = $(e.currentTarget)
22
+ array_element_block = link.parent()
23
+ if link.hasClass("up")
24
+ prev = array_element_block.prev(".rails_admin_settings_array_element_block")
25
+ array_element_block.insertBefore(prev) if prev.length > 0
26
+ if link.hasClass("down")
27
+ next = array_element_block.next(".rails_admin_settings_array_element_block")
28
+ array_element_block.insertAfter(next) if next.length > 0
29
+ return false
30
+
31
+
32
+
33
+ $(document).on "change", "#edit_rails_admin_settings_setting .raw_array_field :input", (e)->
34
+ field_block = $(e.currentTarget).closest(".raw_array_field")
35
+ hidden_field = field_block.find("[type='hidden']")
36
+ if field_block.find(":input:not([type='hidden'])").serializeArray().length == 0
37
+ hidden_field.prop('name', hidden_field.data('name')) if hidden_field.data('name')
38
+ else
39
+ hidden_field.data('name', hidden_field.prop('name')) if hidden_field.prop('name')
40
+ hidden_field.prop('name', '')
41
+
42
+
43
+ $(document).on "rails_admin.dom_ready", (e)->
44
+ $("#edit_rails_admin_settings_setting .raw_array_field").find(":input[type='hidden']").trigger('change')
45
+
46
+
47
+ window.rails_admin_settings ||= {}
48
+ window.rails_admin_settings.array_loaded = true
@@ -1,32 +1,37 @@
1
- $(document).on "click", "#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_add_link", (e)->
2
- e.preventDefault()
3
- link = $(e.currentTarget)
4
- link_parent = link.parent()
5
- link_parent.before(link.data('template'))
6
- $("#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_block input:last").blur()
7
- return false
1
+ if !window.rails_admin_settings or !window.rails_admin_settings.hash_loaded
2
+ $(document).on "click", "#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_add_link", (e)->
3
+ e.preventDefault()
4
+ link = $(e.currentTarget)
5
+ link_parent = link.parent()
6
+ link_parent.before(link.data('template'))
7
+ $("#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_block input:last").blur()
8
+ return false
8
9
 
9
10
 
10
- $(document).on 'click', '#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_delete_link', (e)->
11
- e.preventDefault()
12
- $(e.currentTarget).parent().remove()
13
- return false
11
+ $(document).on 'click', '#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_delete_link', (e)->
12
+ e.preventDefault()
13
+ $(e.currentTarget).parent().remove()
14
+ return false
14
15
 
15
- $(document).on 'blur', '#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_key_field', (e)->
16
- e.preventDefault()
17
- input = $(e.currentTarget).siblings('input')
18
- old_id = input.prop('id')
19
- old_name = input.prop('name')
20
- new_name = e.currentTarget.value
21
- reg_for_id = /\[[^\[\]]+\]$/i
22
- reg_for_name = /\[[^\[\]]+\]\]$/i
23
- input.prop('id', old_id.replace(reg_for_id, "[" + new_name + "]"))
24
- input.prop('name', old_name.replace(reg_for_name, "[" + new_name + "]]"))
25
- return false
16
+ $(document).on 'blur', '#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_key_field', (e)->
17
+ e.preventDefault()
18
+ input = $(e.currentTarget).siblings('input')
19
+ old_id = input.prop('id')
20
+ old_name = input.prop('name')
21
+ new_name = e.currentTarget.value
22
+ reg_for_id = /\[[^\[\]]+\]$/i
23
+ reg_for_name = /\[[^\[\]]+\]\]$/i
24
+ input.prop('id', old_id.replace(reg_for_id, "[" + new_name + "]"))
25
+ input.prop('name', old_name.replace(reg_for_name, "[" + new_name + "]]"))
26
+ return false
26
27
 
27
28
 
28
- $(document).on 'blur', '#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_block input', (e)->
29
- fields_block = $(e.currentTarget).closest(".controls")
30
- fields_block.find('.value_field').each ->
31
- $(this).parent().removeClass('duplicate')
32
- fields_block.find('.value_field').not($(this)).filter("[name='" + this.name + "']").parent().addClass('duplicate')
29
+ $(document).on 'blur', '#edit_rails_admin_settings_setting .raw_hash_field .rails_admin_settings_hash_element_block input', (e)->
30
+ fields_block = $(e.currentTarget).closest(".controls")
31
+ fields_block.find('.value_field').each ->
32
+ $(this).parent().removeClass('duplicate')
33
+ fields_block.find('.value_field').not($(this)).filter("[name='" + this.name + "']").parent().addClass('duplicate')
34
+
35
+
36
+ window.rails_admin_settings ||= {}
37
+ window.rails_admin_settings.hash_loaded = true
@@ -1,3 +1,3 @@
1
1
  module RailsAdminSettings
2
- VERSION = "1.2.3.1".freeze
2
+ VERSION = "1.2.3.2".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ack_rails_admin_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3.1
4
+ version: 1.2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kiseliev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-08-07 00:00:00.000000000 Z
12
+ date: 2017-08-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid