material_raingular 0.5.5 → 0.5.8

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
  SHA1:
3
- metadata.gz: 6506567f3b69bc2a7c04e433427709025d541cb7
4
- data.tar.gz: 2d3b5e0b2b42ea631de6d44328709b15153ed112
3
+ metadata.gz: f2b9757f66f226da04042069022eddcaacfa0bd0
4
+ data.tar.gz: 97878f7b41057912ca7b2d8dcf4a06ccc3077d7f
5
5
  SHA512:
6
- metadata.gz: 0367a9a2ca9fdb7bd6e5255a06d43fb55938e43fee713ba721539e8f0e3ec41610e8a16b599cfa6c4cf564afd5f3fb2889d94c7de24d29631c49df7019c63ce0
7
- data.tar.gz: fd955eeb2960a25d3b1e2bc28a560726268808e65dc8f1337c6d9143779434e8b581f03a3dd394465d7b32d0cfd768bada86ab965a84b52be387b6eb110a5ade
6
+ metadata.gz: ac2a3922290dcd942ab6fa0c20a104c0afa6ddacf59d22e8d6efd359e9b9eb3dcac3cc51dbbe8708a362f2465180d863aca35bfc720e78bc86b47308fe16dcd8
7
+ data.tar.gz: 9df84680fac873811d8a6cbcb063287544a08c9b318a47f202594ee8ade52c9e48ea9e6cb9ca65840fe9638156c096a9f300f2093970c76feb4c5e029c80d518
@@ -6,19 +6,27 @@ class DirectiveModels.MrUpdateModel extends AngularLinkModel
6
6
  )
7
7
  initialize: ->
8
8
  [@ngModelCtrl,@mrCallbackCtrl] = @$controller
9
- [@parent,@atom] = Helpers.NgModelParse(@$attrs.ngModel,@$scope)
10
- @parentVal = @$parse(@parent)
9
+ @parsed = Helpers.NgModelParse(@$attrs.ngModel,@$scope)
10
+ @atom = @parsed.pop()
11
+ @parent = @parsed.pop()
12
+ @parentVal = ->
13
+ @parsedScope = @$scope
14
+ @parsedScope = @$parse(atom)(@parsedScope) for atom in @parsed
15
+ @$parse(@parent)(@parsedScope)
11
16
  @atomVal = @$parse(@atom)
12
17
  @_resourcify()
13
18
  @_bind()
14
19
 
15
20
  @register(Directives.MrUpdate)
16
21
 
22
+ _klass: ->
23
+ @$attrs.mrUpdateKlass || @parent.classify()
17
24
  _resourcify: ->
18
- ActiveRecord.$Resource._resourcify(@parentVal(@$scope),@parent.classify())
25
+ return unless @parentVal()
26
+ ActiveRecord.$Resource._resourcify(@parentVal(),@_klass())
19
27
  _update: ->
20
28
  @_resourcify()
21
- @parentVal(@$scope).$save.bind(@parentVal(@$scope))().then((data) => @mrCallbackCtrl?.evaluate(data))
29
+ @parentVal().$save.bind(@parentVal())().then((data) => @mrCallbackCtrl?.evaluate(data))
22
30
  _bind: -> @$timeout => @_bindInput()[@_funcName()]()
23
31
  _bindInput: =>
24
32
  radio: => @_boundUpdate('input',true)
@@ -32,7 +32,7 @@ class testDirective extends AngularDirectiveModel
32
32
  class @AngularDirective extends AngularModel
33
33
  # Automatically registers the controller to the module
34
34
  @register: (app, name,type) ->
35
- name ?= (@name || @toString().match(/function\s*(.*?)\(/)?[1]).tableize().camelize('lower').singularize()
35
+ name ?= (@name || @toString().match(/function\s*(.*?)\(/)?[1]).underscore().camelize('lower')
36
36
  app?[type || 'directive'] name, ['$injector', ($injector) => new @($injector)]
37
37
  constructor: ($injector) ->
38
38
  # Bind injected dependencies on scope ie @$scope
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.8"
3
3
  end
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.5.5
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-16 00:00:00.000000000 Z
11
+ date: 2017-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler