material_raingular 0.0.3.2 → 0.0.3.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e35311a439a311e15be760517961b55996f0fb
|
4
|
+
data.tar.gz: 3fffeed340c6884dba3e83126d4cfa3ef77e9cc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a06280b078376d593a0c8ff714c5ed12b3457b474c03548508b7688707d2195df517a6e749cb870dfe947c2ae96d1bb394342663fb7d2c3214a303c61a0a170
|
7
|
+
data.tar.gz: 7dafa13ef461765d2153174a04eb079fb5c116aa3f3c69b4f7b64aafda3efd42a61aeb65554174f1b11fe7cceb2f75ba490d6c8a2928b1da5dabf35ae7f75cd9
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class ElementUpdate
|
2
2
|
constructor: (scope,element,attributes,controllers,RailsUpdater,timeout,parse) ->
|
3
3
|
[@ngModelCtrl,@ngCallbackCtrl,@ngTrackByCtrl] = controllers
|
4
|
-
@updater = RailsUpdater.new(scope,controllers,attributes.ngModel,attributes.ngOverride)
|
4
|
+
@updater = RailsUpdater.new(scope,controllers,attributes.ngModel,attributes.ngOverride,attributes.ngFactory)
|
5
5
|
@type = attributes.type
|
6
6
|
@tagName = element[0].tagName
|
7
7
|
@modelName = attributes.ngModel
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class RailsUpdate
|
2
|
-
constructor: ($injector,$parse,factoryName,scope,controllers,model,override)->
|
2
|
+
constructor: ($injector,$parse,factoryName,scope,controllers,model,override,ngFactory)->
|
3
3
|
@injector = $injector
|
4
4
|
@factoryName = factoryName
|
5
5
|
@scope = scope
|
@@ -10,9 +10,10 @@ class RailsUpdate
|
|
10
10
|
else
|
11
11
|
[@modelName,@atomName] = modelName.split('.')
|
12
12
|
@override = !!override
|
13
|
-
@factory = @injector.get(@factoryName(@modelName))
|
13
|
+
@factory = @injector.get(@factoryName(ngFactory || @modelName))
|
14
14
|
@controllers = controllers.slice(0)
|
15
15
|
@ngModelCtrl = @controllers.shift()
|
16
|
+
@railsName = ngFactory || @modelName
|
16
17
|
return @
|
17
18
|
equiv: (left,right) ->
|
18
19
|
return true if left == right
|
@@ -20,21 +21,20 @@ class RailsUpdate
|
|
20
21
|
false
|
21
22
|
update: (value) ->
|
22
23
|
atomName = if typeof @atomName == 'function' then @atomName(@scope) else @atomName
|
23
|
-
@value = if @override then scope.$eval(atomName) else value
|
24
|
+
@value = if @override then @scope.$eval(atomName) else value
|
24
25
|
object = {id: @scope.$eval(@modelName).id}
|
25
|
-
object[@
|
26
|
-
object[@
|
26
|
+
object[@railsName] = {}
|
27
|
+
object[@railsName][atomName] = value
|
27
28
|
unless @scope[@modelName].currently_updating
|
28
29
|
@scope[@modelName].currently_updating = true
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
for controller in up.controllers
|
30
|
+
@factory.update object, (returnData) =>
|
31
|
+
@scope[@modelName].currently_updating = false
|
32
|
+
unless @equiv(@ngModelCtrl.$viewValue,returnData[@atomName])
|
33
|
+
@ngModelCtrl.$setModelValue = returnData[@atomName]
|
34
|
+
@ngModelCtrl.$render()
|
35
|
+
for controller in @controllers
|
36
36
|
controller.evaluate(returnData) if !!controller
|
37
37
|
angular.module 'RailsUpdater', ['Factories', 'FactoryName']
|
38
38
|
.factory 'RailsUpdater', ($injector,factoryName,$parse) ->
|
39
|
-
new: (scope,controllers,model,override)->
|
40
|
-
return new RailsUpdate($injector,$parse,factoryName,scope,controllers,model,override)
|
39
|
+
new: (scope,controllers,model,override,ngFactory)->
|
40
|
+
return new RailsUpdate($injector,$parse,factoryName,scope,controllers,model,override,ngFactory)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: material_raingular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.3.
|
4
|
+
version: 0.0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Moody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|