bootstrap-editable-rails 0.0.6 → 0.0.7
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
|
-
|
4
|
-
|
3
|
+
data.tar.gz: a3d6799428ff1f761a995a19917424eb3c4b475e
|
4
|
+
metadata.gz: 2ffee4e362be3020dcec4ef4ee4ca179ae29d936
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
data.tar.gz: 26f7a2fddb88768584d8b8a059e96f18c13315852b8878118ee7451dda324437ac04d0055210287d351bdeb34186fa2e73fd37e37cbc3d661b20b9c063da0572
|
7
|
+
metadata.gz: 9058f215c150d79c92f7cf6766cc3d2c884f25c849ae3844aa0345714ab3742ab7b77e842c2273f655df44b5533ff1e41fd4b8256d310221b19057119fff5a03
|
@@ -3,31 +3,32 @@
|
|
3
3
|
|
4
4
|
jQuery ($) ->
|
5
5
|
EditableForm = $.fn.editableform.Constructor
|
6
|
-
EditableForm
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
originalUrl
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
6
|
+
unless EditableForm::saveWithUrlHook?
|
7
|
+
EditableForm::saveWithUrlHook = (value) ->
|
8
|
+
originalUrl = @options.url
|
9
|
+
resource = @options.resource
|
10
|
+
@options.url = (params) =>
|
11
|
+
# TODO: should not send when create new object
|
12
|
+
if typeof originalUrl == 'function' # user's function
|
13
|
+
originalUrl.call(@options.scope, params)
|
14
|
+
else if originalUrl? && @options.send != 'never'
|
15
|
+
# send ajax to server and return deferred object
|
16
|
+
obj = {}
|
17
|
+
obj[params.name] = params.value
|
18
|
+
# support custom inputtypes (eg address)
|
19
|
+
if resource
|
20
|
+
params[resource] = obj
|
21
|
+
else
|
22
|
+
params = obj
|
23
|
+
delete params.name
|
24
|
+
delete params.value
|
25
|
+
delete params.pk
|
26
|
+
$.ajax($.extend({
|
27
|
+
url : originalUrl
|
28
|
+
data : params
|
29
|
+
type : 'PUT' # TODO: should be 'POST' when create new object
|
30
|
+
dataType: 'json'
|
31
|
+
}, @options.ajaxOptions))
|
32
|
+
@saveWithoutUrlHook(value)
|
33
|
+
EditableForm::saveWithoutUrlHook = EditableForm::save
|
34
|
+
EditableForm::save = EditableForm::saveWithUrlHook
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-editable-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toru KAWAMURA
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-09 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|