material_raingular 0.1.5.7 → 0.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e0393643725a1838a50e538e3ad917ee4a4133c
|
4
|
+
data.tar.gz: 9590d088ae6c6c8e8aadf617b6bb1e652887db77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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)
|