material_raingular 0.0.2.1.alpha → 0.0.2.2.alpha

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: 08cc207d34aa842e056bc182d7e2b10bd9a7e9ca
4
- data.tar.gz: 58d6d0f4258975cfa5ccba21c9ee2676f7260bcc
3
+ metadata.gz: 8f4bafa4b82c0d39b72aeaa1a4f961eac083d006
4
+ data.tar.gz: 48c3218cac0c9a8c0b3d876d96400f4d0af6e332
5
5
  SHA512:
6
- metadata.gz: 5a8a69ce3377ae510b42767feeed4818ef4c018efe1e84ce34b06604df0d650a843b42b38302caaaf8a26177207f7e13bb9e49477b5dc7bb79b0dff6d1a47597
7
- data.tar.gz: f6899269b8c25406a2467c26ff3a97e5f37824753049051c46a35c9d2eda19703a594e50f72f3b87d06da01ae031503c783fd756da9eda2096774bc550478ad9
6
+ metadata.gz: 67b192275c4c10e726f7052936fce35f457304fa47f455d5b6dc6f0527bde2839d45988faa280ebae2327ddf6bcb2a0888ce89be07a1137cf65263ded6eb4d34
7
+ data.tar.gz: 8e8791473dc0f61654f27fc79cd3251a618f4639682de4670bc12fc1362f45fa64a4205ae906491455c1e2fedc41e49e0c584efec6c5c8e6bbc8d0b62670d1ee
@@ -88,20 +88,25 @@ angular.module 'NgUpdate', ['Factories', 'FactoryName']
88
88
  object = {id: scope[data[0]]['id']}
89
89
  object[data[0]] = {id: scope[data[0]]['id']}
90
90
  object[data[0]][data[1]] = scope[data[0]][data[1]]
91
+ object[data[0]].lock_version = scope[data[0]].lock_version
91
92
  list = $injector.get(factory)
92
93
 
93
- list.update object, (returnData) ->
94
- for tracked in trackby
95
- scope[data[0]][tracked] = returnData[tracked]
96
- scope[data[0]][data[1]] = returnData[data[1]] if equiv(scope[data[0]][data[1]], object[data[0]][data[1]]) && !equiv(scope[data[0]][data[1]], returnData[data[1]])
97
- scope[data[0]].errors = returnData.errors
98
- callFunctions = []
99
- for callFunction in functions
100
- [match,func,args] = callFunction.match(/(.*)\((.*)\)/)
101
- if typeof scope[func] == 'function'
102
- scope[func](args,returnData)
103
- else if typeof window[func] == 'function'
104
- window[func](args,returnData)
94
+ unless scope[data[0]].currently_updating
95
+ console.dir scope[data[0]].currently_updating
96
+ scope[data[0]].currently_updating = true
97
+ list.update object, (returnData) ->
98
+ scope[data[0]].currently_updating = false
99
+ for tracked in trackby
100
+ scope[data[0]][tracked] = returnData[tracked]
101
+ scope[data[0]][data[1]] = returnData[data[1]] if equiv(scope[data[0]][data[1]], object[data[0]][data[1]]) && !equiv(scope[data[0]][data[1]], returnData[data[1]])
102
+ scope[data[0]].errors = returnData.errors
103
+ callFunctions = []
104
+ for callFunction in functions
105
+ [match,func,args] = callFunction.match(/(.*)\((.*)\)/)
106
+ if typeof scope[func] == 'function'
107
+ scope[func](args,returnData)
108
+ else if typeof window[func] == 'function'
109
+ window[func](args,returnData)
105
110
  if element[0].tagName == 'INPUT'
106
111
  if attributes.type == 'radio' || attributes.type == 'checkbox' || attributes.type == 'date'
107
112
  element.bind 'input', (event) ->
@@ -5,11 +5,15 @@ angular.module('Table', [])
5
5
  tableLoaded = ->
6
6
  element.find('tbody').find('td').length > 0
7
7
  parentHeights = ->
8
- heights = [element[0].offsetHeight]
9
- parent = element[0].parentElement
8
+ heights = []
9
+ potential = element[0]
10
+ until parent
11
+ potential = potential.parentElement
12
+ parent = potential if (potential.tagName == attributes.stickyHeader.toUpperCase() || !attributes.stickyHeader)
10
13
  until !parent
11
14
  heights.push(parent.offsetHeight)
12
15
  parent = parent.parentElement
16
+ heights
13
17
  minimumParentHeight = ->
14
18
  Math.min.apply(Math, parentHeights())
15
19
  maximumParentHeight = ->
@@ -19,6 +23,7 @@ angular.module('Table', [])
19
23
  thead = ->
20
24
  angular.element(element.find('thead')[0])
21
25
  initialize = ->
26
+ bodyWatcher() if bodyWatcher
22
27
  parent = angular.element(element[0].parentElement)
23
28
  parent.css('min-height', minimumParentHeight() + 'px')
24
29
  parent.css('max-height', maximumParentHeight() + 'px')
@@ -30,6 +35,12 @@ angular.module('Table', [])
30
35
  theight = minimumParentHeight() - thead()[0].offsetHeight - 20
31
36
  tbody().css('display', 'block').css('overflow-y', 'auto').css('height', theight + 'px').css('overflow-x', 'hidden')
32
37
  thead().css('display','block').css('width', tbody().find('tr')[0].offsetWidth + 'px')
38
+ bodyWatcher = scope.$watch bodyWidth, (val,old) ->
39
+ unless val == old
40
+ $timeout ->
41
+ reinitialize()
42
+ bodyWidth = ->
43
+ tbody()[0].offsetWidth
33
44
  reinitialize = ->
34
45
  tbody().css('display','')
35
46
  thead().css('display','')
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.0.2.1.alpha"
2
+ VERSION = "0.0.2.2.alpha"
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.0.2.1.alpha
4
+ version: 0.0.2.2.alpha
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-08-07 00:00:00.000000000 Z
11
+ date: 2015-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler