material_raingular 0.0.2.4.6.alpha → 0.0.2.4.7.alpha
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df4d672f568ee580bebdb816f8b00f01067937bd
|
4
|
+
data.tar.gz: 36299cbc73efd8e05f34f2017ad495dadb1b1637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f34a2aac81912db2aeeec3287e2c79e3c142efc1aa3eeb9bf06f3a6937b99406a2a7e761f0527bfd014f0fbfdd275120b5248cae18eb2b88b0ecca545147226a
|
7
|
+
data.tar.gz: ee235aec1e42082784d83e62da149966ecc3aca2ec4763bee4ae196f0cf0a38dc18664ddb4057665b60db2d98c953dc0d76d33d8d0efbe3c238b279b0bb30c18
|
@@ -102,34 +102,33 @@ angular.module('AutoComplete', [ 'FactoryName'])
|
|
102
102
|
link: (scope, element, attributes, ngModel) ->
|
103
103
|
if element[0].tagName == 'INPUT'
|
104
104
|
element.bind 'focus', ->
|
105
|
-
pos = element.position()
|
105
|
+
pos = element.position() if element.position
|
106
106
|
element.next()[0].style.left = '0px'
|
107
107
|
element.bind 'blur', ->
|
108
|
-
element
|
108
|
+
active = angular.element(element.next()[0].getElementsByClassName('active')[0])
|
109
|
+
active.removeClass('active')
|
109
110
|
ngModel.$setViewValue(element.val())
|
110
111
|
ngModel.$render()
|
111
112
|
element.bind 'keydown', (input)->
|
112
|
-
|
113
|
-
|
113
|
+
keypress = (direction) ->
|
114
|
+
index = if direction == 'next' then 0 else element.next().find('a').length - 1
|
115
|
+
selected = angular.element(element.next()[0].getElementsByClassName('active')[0])
|
114
116
|
if selected.hasClass('active')
|
115
117
|
selected.removeClass('active')
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
until complete
|
119
|
+
selected = angular.element(selected[0][direction + 'Sibling']) if selected[0]
|
120
|
+
complete = !!selected[0]
|
121
|
+
complete = selected[0].tagName == 'A' if complete
|
122
|
+
complete = true if !selected[0]
|
123
|
+
selected = angular.element(element.next().find('a')[index]) unless selected[0]
|
124
|
+
ind = 0
|
125
|
+
for el,i in element.next()[0].getElementsByTagName('a')
|
126
|
+
ind = i if el == selected[0]
|
127
|
+
scroll = selected[0].scrollHeight * ind
|
121
128
|
selected[0].parentElement.scrollTop = scroll
|
122
129
|
selected.addClass('active')
|
123
130
|
element.val(selected.text())
|
131
|
+
if input.keyCode == 40
|
132
|
+
keypress('next')
|
124
133
|
if input.keyCode == 38
|
125
|
-
|
126
|
-
if selected.hasClass('active')
|
127
|
-
selected.removeClass('active')
|
128
|
-
selected = selected.prev('a')
|
129
|
-
else
|
130
|
-
selected = element.next().find('a').last()
|
131
|
-
if !selected.html() then selected = element.next().find('a').last()
|
132
|
-
scroll = selected[0].scrollHeight * element.next().find('a').index(selected)
|
133
|
-
selected[0].parentElement.scrollTop = scroll
|
134
|
-
selected.addClass('active')
|
135
|
-
element.val(selected.text())
|
134
|
+
keypress('previous')
|
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.4.
|
4
|
+
version: 0.0.2.4.7.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-09-
|
11
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|