material_raingular 0.0.4.3 → 0.0.5

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: 8d1099f86d79c7a785d7a04c0ecee5bab2a6b94d
4
- data.tar.gz: fcfb376bb6e54f7162892dc1295dcf33a43632e6
3
+ metadata.gz: 03980b9a6d9bf6a3d71f36453f0f5eee0f399de8
4
+ data.tar.gz: 6e5458e8885aa46d0b974f3065052d17cd3b0d03
5
5
  SHA512:
6
- metadata.gz: 47379b9618bfffa903291868cb06d6f857f10c9654f40c0c51e3d9c604e4bb5079ea59a236346f2f76e0b7bd142dbb5da208c2e08ffcbf517e580ff8d9ab3307
7
- data.tar.gz: 7d50f1205b362df6e66f74c3a7d05894dbb0a71b0722760505282e6259c061f877cec9af0834772637a4c82612492d62b1bc53df91d458bccfca84ca1fabf762
6
+ metadata.gz: e9c572a1c47ece8bbf2655d8ab03dc7c736fd37275b004440b4852c3fb6c221ca6e8d023fdcbd67175f0b518f82e0468c4f4375e9bd6be608d3d80356eed2761
7
+ data.tar.gz: 115da2a6610b43fa3111186ed8f78a601937ddcc929d925436d5afc4d22f171f728500cd8a1cb10ff49445b8232c67cfca23d672dba9cbe5589c6fb0a13d36ad
@@ -79,8 +79,9 @@ class StandardTemplate
79
79
  @stylize()
80
80
  @bind()
81
81
  stylize: ->
82
+ @search.css('width',window.getComputedStyle(@element[0]).width)
82
83
  @search.addClass('md-input') if @element.hasClass('md-input')
83
- @search.css({'width': '100%','color': 'black'})
84
+ @search.css('color', 'black')
84
85
  @element.css('position','relative').css('overflow','visible')
85
86
  @span.css('overflow','hidden').css('width','100%').css('display','inline-block').css('position','relative')
86
87
  searchCss = window.getComputedStyle(@search[0])
@@ -60,7 +60,10 @@ uploadFiles = (scope,element,model,id,file,parent,timeout,callback) ->
60
60
  , 2000
61
61
 
62
62
  xhr.open("PUT", route)
63
- xhr.setRequestHeader('X-CSRF-Token', $('meta[name=csrf-token]').attr('content'))
63
+ csrf = null
64
+ for tag in document.getElementsByTagName('meta')
65
+ csrf = tag.content if tag.name == 'csrf-token'
66
+ xhr.setRequestHeader('X-CSRF-Token', csrf)
64
67
  xhr.send(formData)
65
68
 
66
69
  angular.module('NgUpload', [])
@@ -69,13 +72,30 @@ angular.module('NgUpload', [])
69
72
  restrict: 'A'
70
73
  require: 'ngModel'
71
74
  link: (scope, element, attributes) ->
75
+ dragHovered = 0
76
+ el = angular.element("<div class='hovered-cover'>Drop Files Here</div>")
77
+ element.bind 'dragenter', (event) ->
78
+ dragHovered += 1
79
+ element.addClass('hovered') if dragHovered == 1
80
+ element.append el if dragHovered == 1
81
+ height = window.getComputedStyle(element[0]).height
82
+ el.css('height', height)
83
+ el.css('line-height',height)
84
+ el.css('margin-top', '-' + height)
85
+ element.bind 'dragleave', (event) ->
86
+ dragHovered -= 1
87
+ element.removeClass('hovered') if dragHovered == 0
88
+ el.remove() if dragHovered == 0
72
89
  element.bind 'dragover', (event) ->
73
90
  event.preventDefault()
74
91
  event.stopPropagation()
75
92
  element.bind 'drop', (event) ->
76
93
  event.preventDefault()
77
94
  event.stopPropagation()
78
- file = event.originalEvent.dataTransfer.files[0]
95
+ element.removeClass('hovered')
96
+ el.remove()
97
+ dragHovered = 0
98
+ file = (event.originalEvent || event).dataTransfer.files[0]
79
99
  selectFile(scope,event,attributes,file)
80
100
  scope.file = ->
81
101
  fileData(scope,attributes)
@@ -97,7 +117,7 @@ angular.module('NgUpload', [])
97
117
  <div class="ng-progress-bar">
98
118
  <span class="bar" style="width: {{uploadProgress() || 0}}%;"></span><span class="text" style="margin-left: -{{uploadProgress() || 0}}%;">{{uploadProgress()}}%</span>
99
119
  </div>
100
- <input accept="{{accept()}}" ng-model="ngModel" type="file" /><img ng-show="show(&#39;image&#39;)" ng-src="{{file().thumb}}" />
120
+ <input accept="{{accept()}}" ng-model="ngModel" type="file" ng-class="{image: show(&#39;image&#39;)}" /><img ng-show="show(&#39;image&#39;)" ng-src="{{file().thumb}}" />
101
121
  <div class="button" ng-show="show(&#39;button&#39;)">
102
122
  Select File
103
123
  </div>
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.0.4.3"
2
+ VERSION = "0.0.5"
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.4.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-21 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler