material_raingular 0.1.5.7 → 0.1.5.8

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: 87900cb5cfda046b66f490c362d69815a356ecfc
4
- data.tar.gz: 903cad3836f5f800e41105557abf660bb7ebe9e6
3
+ metadata.gz: 0e0393643725a1838a50e538e3ad917ee4a4133c
4
+ data.tar.gz: 9590d088ae6c6c8e8aadf617b6bb1e652887db77
5
5
  SHA512:
6
- metadata.gz: e0fda726acb4457345625ccf31e73a6b01c6eff27b7818994dba3dff82cef514428f6b98cf07a51f46c18a3916e8634e06e48ce66f0e45dcff1fbe5e32fe22e1
7
- data.tar.gz: 364dc80a2a99d10e29575375d52f856d17c852cf04b3a3cc0c9c34acdac66e1f55e31f00a951cb80e8abb2b65ace9127df4c3922da91c5b7224e22af7e65fd9e
6
+ metadata.gz: 74c5784dbbb8f964d0b2b36a0942b8244c53bf081172bd376aa8951a542e8bb664f673365dc0a592c7c31501a5bcd6f85f5d5e5fe37972441940611009208095
7
+ data.tar.gz: 4efdc8a22b21d67bda209d75374b44fedafaa12bc5717286b33fccba1f61d1a67b3e2b0cac2d99a7fec9a156c6da796089a7c8775dba98d829990e9a257cde03
@@ -25,6 +25,7 @@ PrimitiveValueFunction = (s,l,a,i) ->
25
25
 
26
26
  class SelectFunctions
27
27
  constructor: (match,parse,options) ->
28
+ @repeater = match[5]
28
29
  @collection = parse(match[8])
29
30
  @modelValue = match[1].replace(match[5] + '.','')
30
31
  @viewValue = if match[2] then match[2].replace(match[5] + '.','') else @modelValue
@@ -116,7 +117,7 @@ class StandardTemplate
116
117
  @element.append @tempHolder
117
118
 
118
119
  class EventFunctions
119
- constructor: (@functions,@buildTemplate,@updateValue,@filteredList,@filter,@timeout,@parse,@scope,@disabled,@options) ->
120
+ constructor: (@functions,@buildTemplate,@updateValue,@filteredList,@filter,@timeout,@parse,@scope,@disabled,@options,@changeFn) ->
120
121
 
121
122
  inputFunction: (search,typeAhead,event) =>
122
123
  location = search[0].selectionStart
@@ -155,8 +156,9 @@ class EventFunctions
155
156
  obj[@functions.viewValue] = search.val()
156
157
  collection = @functions.collection(@scope)
157
158
  if @options.allowNew
158
- collection.push(obj) unless collection.includes(obj)
159
+ collection.push(obj) unless collection.pluck(@functions.viewValue).includes(obj[@functions.viewValue])
159
160
  val = @filteredList(!@options.allowNew,false,@options.allowNew,true)[0]
161
+ @changeFn(@scope)(val) if @changeFn
160
162
  @updateValue @functions.modelValueFn(val)
161
163
 
162
164
  keydownFunction: (search,typeAhead,template,input) =>
@@ -313,10 +315,10 @@ angular.module('FilteredSelect', [])
313
315
  form ||= element[0]
314
316
  return true if form.disabled
315
317
  return false
316
-
318
+ changeFn = if attrs.fsChange then $parse(attrs.fsChange) else null
317
319
  options = new SelectOptions(attrs.ngSelectOptions,element[0].outerHTML)
318
320
  functions = new SelectFunctions(options.match,$parse,viewOptions)
319
- eFunctions = new EventFunctions(functions,buildTemplate,updateValue,filteredList,$filter,$timeout,$parse,scope,disabled,viewOptions)
321
+ eFunctions = new EventFunctions(functions,buildTemplate,updateValue,filteredList,$filter,$timeout,$parse,scope,disabled,viewOptions,changeFn)
320
322
  if isMobile = typeof attrs.ngMobile != 'undefined'
321
323
  elements = new MobileTemplate(element,eFunctions.mobile())
322
324
  else
@@ -43,7 +43,9 @@ Array.prototype.sum = ->
43
43
  total += parseFloat(i) if i
44
44
  total
45
45
  Array.prototype.includes = (entry)->
46
- this.indexOf(entry) > -1
46
+ unless entry.hasOwnProperty('id')
47
+ return @.indexOf(entry) > -1
48
+ @.pluck('id').includes(entry.id)
47
49
  Array.prototype.drop = (entry)->
48
50
  if entry.hasOwnProperty('id')
49
51
  index = @.pluck('id').indexOf(entry.id)
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.1.5.7"
2
+ VERSION = "0.1.5.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_raingular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5.7
4
+ version: 0.1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moody