flammarion_rails 0.3.3 → 0.3.4

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: ed1eb9d5f1b65463d847a261743c518f2124b88a
4
- data.tar.gz: 0541f306b1d2bcb44e58db573401fdba455d0fe7
3
+ metadata.gz: 83c30fbcfbb8e146638539e4ea9ee56db8206cff
4
+ data.tar.gz: bc8062f461467269a530e7b7d9511db7f2844839
5
5
  SHA512:
6
- metadata.gz: 034eb99981273326a34e5ccaef0266ab37780b4d7bc7b58bb32ec84855a6622f042dffe0f3cc580174125a58ba5ddb321508ae2f2db01675e3528867e5232053
7
- data.tar.gz: a1af72be79392c234d30c1ba138f1cab2784c7d22d50e942780ef9135f03300e08a6d3c870498f5521c6d47fce6232897f3a8de0abba06b913ec4841e178de02
6
+ metadata.gz: bd5ea761193405ba03bd345917ba61b1367c8f19a06361eeccf134c9658b453831e61a5d7a6c8f563c996aebde1255e4bd6836a50af43e28c3814f849d3b668c
7
+ data.tar.gz: 19c0afb3e4ee7bd2ec762edcd2d11735a6325ea98e83f83e6c52f1e6c2b19b81563fac04b7b8a330ae19964552614c6e7dddf19761b5a6f4de6fb9e58af2e491
@@ -96,6 +96,24 @@ ws.onmessage_before_actions.unshift (event) ->
96
96
  window.ws_file = null
97
97
  ws.onmessage_skip_action = true
98
98
 
99
+ # Modal
100
+ ########################################
101
+ # Note: workaround so it doesn't crash
102
+
103
+ $(document).on 'rails_admin.dom_ready', ->
104
+ $('[data-link]').each (_index, element) ->
105
+ link = $(element)
106
+ path = link.attr('data-link')
107
+ if path.match /__ID__/
108
+ path = path.replace(/__ID__.*/, '')
109
+ else
110
+ path = path.replace('modal=true', '')
111
+ $(link).replaceWith """
112
+ <a href="#{path}" class="#{link.attr('class')} pjax" style="#{link.attr('style')}">
113
+ #{link.html()}
114
+ </a>
115
+ """
116
+
99
117
  # Ajax
100
118
  ########################################
101
119
  # Note: app specific, $.ajax must be overriden
@@ -104,11 +122,10 @@ ws.onmessage_before_actions.unshift (event) ->
104
122
  #
105
123
  # $.ajax = (xhr) ->
106
124
  # if xhr.type?
107
- # return ws.ajax_handler(xhr)
125
+ # return window.ajax_handler(xhr)
108
126
  #
109
127
  # switch xhr.dataType
110
128
  # when 'text'
111
- # modal = $('#modal').data('ra-remoteForm')
112
129
  # ...
113
130
  # when 'json'
114
131
  # ...
@@ -1,3 +1,3 @@
1
1
  module FlammarionRails
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flammarion_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrice Lebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-09 00:00:00.000000000 Z
11
+ date: 2017-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails