dlegr250_material_design 0.6.04 → 0.6.05

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: 0b2bf0ccf4c419795d107fed872677c6824a0266
4
- data.tar.gz: 1413342fded8d2e5a48a4ef6f3eea6c9a2ddbe3c
3
+ metadata.gz: 89a6b920f3558025551525cf41ccbc18ba9a0058
4
+ data.tar.gz: af3a8542735dc424a12bbf43e9bbe5ab9cdb3dea
5
5
  SHA512:
6
- metadata.gz: c7d33724148da1253d382d3115c330a340fcfd87ba9e4fd0a06b696736fed32cc144face79b12abc7696aae875152152e3302f341edaa65bb32dbbecb1e5a064
7
- data.tar.gz: b8373d71daaf9aaa7e853f7b42642030a42b766f6958f360fff1fde6c046bc9434ce5fcd1611f9c3652c1a2b81d2fb1a0df51ce94578ee5716b2b448dcf2c7cb
6
+ metadata.gz: 1cef0ec324878494654f9c3de47a30fcf91f51d4f68b410516bce148ac6c36c061114580fe68b3f0b1b23b0c229143d58acb75e0bef2b75d8e4b0ad3c140289f
7
+ data.tar.gz: d85e533a70aa4a6326abe095a8ea82f75079999cccfe888d765a7f3a331204c8a7754ba096662d374333aad9c1d04ddc1ac4c8fd0bcddb9a9fd2c6bb1c2718a8
data/.DS_Store ADDED
Binary file
@@ -1,3 +1,3 @@
1
1
  module Dlegr250MaterialDesign
2
- VERSION = "0.6.04"
2
+ VERSION = "0.6.05"
3
3
  end
data/vendor/.DS_Store ADDED
Binary file
Binary file
Binary file
@@ -11,4 +11,5 @@ class App.MD.ExpansionPanel
11
11
  $panel.attr("data-state", "collapsed")
12
12
  else
13
13
  $panel.attr("data-state", "expanded")
14
- $editor.froalaEditor("events.focus") if $editor.length > 0
14
+ $details.find("input[autofocus]").focus()
15
+ # $editor.froalaEditor("events.focus") if $editor.length > 0
@@ -26,8 +26,15 @@ class App.MD.Menus
26
26
  @.showMenu($menu)
27
27
  false
28
28
 
29
- $("body").on "click", =>
29
+ $("body").on "click", (e) =>
30
30
  @.hideMenus()
31
+ # $target = $(e.target)
32
+ # if $target.parents(".menu-item").length > 0
33
+ # @.hideMenus()
34
+ # else if $target.parents(".menu").length > 0
35
+ # e.preventDefault()
36
+ # else
37
+ # @.hideMenus()
31
38
 
32
39
  @hideMenus: () ->
33
40
  $(".menu").removeClass("visible")
@@ -3,59 +3,73 @@ jQuery.extend jQuery.fn,
3
3
  @each ->
4
4
  $list = $(this)
5
5
 
6
- # Remove any elements that have a blank sort attribute
7
- # See: http://stackoverflow.com/a/8127904/667772
8
- $collection = $list.children().filter ->
6
+ $children = $list.children()
7
+
8
+ $childrenWithValues = $children.filter (i) ->
9
9
  return !!$(this).attr("data-sort")
10
10
 
11
- # Pre-fetch values to compare
12
- $collectionValues = $collection.map ->
13
- $(this).attr("data-sort")
11
+ $childrenValues = $childrenWithValues.map (i, e) ->
12
+ $(e).attr("data-sort")
13
+
14
+ listLength = $children.length
14
15
 
15
16
  # New element to insert
16
17
  $element = $(element)
17
18
  elementValue = $element.attr("data-sort")
18
19
 
19
- collectionLength = $collection.length
20
- startIndex = 0
21
- endIndex = collectionLength - 1
22
- middleIndex = startIndex + Math.floor((endIndex - startIndex) / 2)
23
-
24
20
  # Edge cases for optimizations
25
21
  #----------------------------------------------------------------------
26
22
 
27
23
  # Empty list, make new element first one
28
- if collectionLength <= 0
24
+ if listLength <= 0
25
+ console.log "list empty"
29
26
  $list.append($element)
30
27
  return
31
28
 
32
29
  # New element does not have a sortable value, add to the bottom
33
30
  if elementValue == null || elementValue == "" # || isNaN(elementValue)
31
+ console.log "element empty"
34
32
  $list.append($element)
35
33
  return
36
34
 
37
- # Less than start element, so prepend to collection
38
- if elementValue <= $collection.first().attr("data-sort")
35
+ # List does not have any items with values, so prepend
36
+ if $childrenWithValues.length == 0
37
+ console.log "list does not have any values"
38
+ $list.append($element)
39
+ return
40
+
41
+ # Less than start element, so prepend to list
42
+ if elementValue < $childrenValues[0]
43
+ console.log "Element < first"
39
44
  $list.prepend($element)
40
45
  return
41
46
 
42
- # Greater than last element, so append to collection
43
- if elementValue >= $collection.last().attr("data-sort")
47
+ # Greater than last element, append to list
48
+ if elementValue > $childrenValues[listLength - 1]
49
+ console.log "element > last"
44
50
  $list.append($element)
45
51
  return
46
52
 
53
+ startIndex = 0
54
+ endIndex = $childrenWithValues.length - 1
55
+ middleIndex = startIndex + Math.floor((endIndex - startIndex) / 2)
56
+
47
57
  # Actual binary search algorithm
48
58
  #----------------------------------------------------------------------
49
59
 
50
60
  while startIndex <= endIndex
51
61
  middleIndex = startIndex + Math.floor((endIndex - startIndex) / 2)
52
62
 
53
- if $collectionValues[middleIndex] > elementValue
63
+ if elementValue < $childrenValues[middleIndex]
54
64
  endIndex = middleIndex - 1
65
+ console.log "#{elementValue} < #{$childrenValues[middleIndex]}"
66
+ console.log "endIndex: #{endIndex}"
55
67
  continue
56
68
 
57
69
  startIndex = middleIndex + 1
58
- if $collectionValues[middleIndex] == elementValue
70
+ console.log "startIndex: #{startIndex}"
71
+ if $childrenValues[middleIndex] == elementValue
59
72
  break
60
73
 
61
- $collection.eq(startIndex).before($element)
74
+ console.log "insert before: #{startIndex}"
75
+ $children.eq(startIndex).before($element)
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dlegr250_material_design
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.04
4
+ version: 0.6.05
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel LeGrand
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-02 00:00:00.000000000 Z
11
+ date: 2018-01-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'WARNING: ALPHA CODE, NOT PRODUCTION READY. ACTIVELY UNDER DEVELOPMENT
14
14
  AS OF AUG 2016. Implement Google Material Design spec with modern browsers in mind
@@ -19,6 +19,7 @@ executables: []
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
+ - ".DS_Store"
22
23
  - ".gitignore"
23
24
  - ".rspec"
24
25
  - ".travis.yml"
@@ -37,6 +38,9 @@ files:
37
38
  - lib/dlegr250_material_design.rb
38
39
  - lib/dlegr250_material_design/version.rb
39
40
  - temp.scss
41
+ - vendor/.DS_Store
42
+ - vendor/assets/.DS_Store
43
+ - vendor/assets/javascripts/.DS_Store
40
44
  - vendor/assets/javascripts/base/init.coffee
41
45
  - vendor/assets/javascripts/components/combobox.coffee
42
46
  - vendor/assets/javascripts/components/datepicker.coffee
@@ -71,12 +75,14 @@ files:
71
75
  - vendor/assets/javascripts/third_party/scroll_scope.min.js
72
76
  - vendor/assets/javascripts/third_party/select2.min.4.0.5.js
73
77
  - vendor/assets/javascripts/third_party/sortable.js
78
+ - vendor/assets/stylesheets/.DS_Store
74
79
  - vendor/assets/stylesheets/base/base.scss
75
80
  - vendor/assets/stylesheets/base/global_classes.scss
76
81
  - vendor/assets/stylesheets/base/mixins.scss
77
82
  - vendor/assets/stylesheets/base/normalize.scss
78
83
  - vendor/assets/stylesheets/base/variables/colors.scss
79
84
  - vendor/assets/stylesheets/base/variables/dimensions.scss
85
+ - vendor/assets/stylesheets/components/.DS_Store
80
86
  - vendor/assets/stylesheets/components/badges.scss
81
87
  - vendor/assets/stylesheets/components/blank_states.scss
82
88
  - vendor/assets/stylesheets/components/boxes.scss
@@ -120,6 +126,7 @@ files:
120
126
  - vendor/assets/stylesheets/components/toggle_panels.scss
121
127
  - vendor/assets/stylesheets/components/tooltips.scss
122
128
  - vendor/assets/stylesheets/dlegr250_material_design.scss
129
+ - vendor/assets/stylesheets/fonts/.DS_Store
123
130
  - vendor/assets/stylesheets/fonts/google_material_design_icons.scss
124
131
  - vendor/assets/stylesheets/fonts/google_material_design_icons/MaterialIcons-Regular.eot
125
132
  - vendor/assets/stylesheets/fonts/google_material_design_icons/MaterialIcons-Regular.svg