material_raingular 0.0.3.3 → 0.0.3.4

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: 75e35311a439a311e15be760517961b55996f0fb
4
- data.tar.gz: 3fffeed340c6884dba3e83126d4cfa3ef77e9cc3
3
+ metadata.gz: 8609bfcee04a6ded9353b2298e1eb65a23dae16d
4
+ data.tar.gz: ca2f8dd1571415e5fb50344198f6c2c046b878b1
5
5
  SHA512:
6
- metadata.gz: 8a06280b078376d593a0c8ff714c5ed12b3457b474c03548508b7688707d2195df517a6e749cb870dfe947c2ae96d1bb394342663fb7d2c3214a303c61a0a170
7
- data.tar.gz: 7dafa13ef461765d2153174a04eb079fb5c116aa3f3c69b4f7b64aafda3efd42a61aeb65554174f1b11fe7cceb2f75ba490d6c8a2928b1da5dabf35ae7f75cd9
6
+ metadata.gz: f1e6e016159912df9b598fe333ef54cdffaf2c689d16645de596b1356678b2aa6b41a6568ebbf192683e2820de79e587e5501f6f1c5839202ff2873c20a7f5a5
7
+ data.tar.gz: c87d4655b5a2044783ba2d9324ef6d1d3a6aefdb4552f3de108583319e4a926da56e74d1543259c71ba83d14561303b4ef324edbb451f1d6e2e32f617d288df2
@@ -98,7 +98,7 @@ class StandardTemplate
98
98
  @element.append @span
99
99
 
100
100
  class EventFunctions
101
- constructor: (@functions,@buildTemplate,@updateValue,@filteredList,@filter,@timeout,@parse,@scope,@disabled) ->
101
+ constructor: (@functions,@buildTemplate,@updateValue,@filteredList,@filter,@timeout,@parse,@scope,@disabled,@options) ->
102
102
 
103
103
  inputFunction: (search,typeAhead,event) =>
104
104
  location = search[0].selectionStart
@@ -115,14 +115,13 @@ class EventFunctions
115
115
  focusFunction: (event) =>
116
116
  @buildTemplate()
117
117
  blurFunction: (search,event) =>
118
- if search.val().length < 4
118
+ if search.val().length < (@options.minLength || 4)
119
119
  search.val('')
120
120
  else
121
121
  obj={}
122
122
  obj[@functions.viewValue] = search.val()
123
123
  val = @filter('filter')(@functions.collection(@scope), obj)[0]
124
124
  @updateValue @functions.modelValueFn(val)
125
- search.css
126
125
  search.val(@functions.viewValueFn(val))
127
126
  keydownFunction: (search,typeAhead,template,input) =>
128
127
  keypress = (direction) ->
@@ -213,14 +212,15 @@ angular.module('FilteredSelect', [])
213
212
  elements.template.append(li)
214
213
  setInitialValue = ->
215
214
  unless isMobile
216
- obj = {}
217
- obj[functions.modelValue] = ngModel.$modelValue
218
- list = $filter('filter')(functions.collection(scope), obj,equiv)
219
- viewScope = list[0] if list
220
- elements.search.val(if viewScope then functions.viewValueFn(viewScope) else '')
221
- elements.typeAhead.html(elements.search.val())
215
+ if model = scope.$eval(attrs.ngModel)
216
+ obj = {}
217
+ obj[functions.modelValue] = scope.$eval(attrs.ngModel)
218
+ list = $filter('filter')(functions.collection(scope), obj,equiv)
219
+ viewScope = list[0] if list
220
+ elements.search.val(if viewScope then functions.viewValueFn(viewScope) else '')
221
+ elements.typeAhead.html(elements.search.val())
222
222
  else
223
- unless model = ngModel.$modelValue
223
+ unless model = scope.$eval(attrs.ngModel)
224
224
  view = attrs.placeholder
225
225
  element.css('color','rgba(0,0,0,0.4)')
226
226
  else
@@ -251,9 +251,10 @@ angular.module('FilteredSelect', [])
251
251
  return true if fieldset[0].attributes.disabled || $parse(ngdis)(scope)
252
252
  return false
253
253
 
254
+ viewOptions = JSON.parse(attrs.filterOptions || '{}')
254
255
  options = new SelectOptions(attrs.ngSelectOptions,element[0].outerHTML)
255
256
  functions = new SelectFunctions(options.match,$parse)
256
- eFunctions = new EventFunctions(functions,buildTemplate,updateValue,filteredList,$filter,$timeout,$parse,scope,disabled())
257
+ eFunctions = new EventFunctions(functions,buildTemplate,updateValue,filteredList,$filter,$timeout,$parse,scope,disabled(),viewOptions)
257
258
  if isMobile = typeof attrs.ngMobile != 'undefined'
258
259
  elements = new MobileTemplate(element,eFunctions.mobile())
259
260
  else
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.0.3.3"
2
+ VERSION = "0.0.3.4"
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.3.3
4
+ version: 0.0.3.4
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-01 00:00:00.000000000 Z
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler