material_raingular 0.0.2.6.6 → 0.0.2.6.7

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: 9363bb292aa1992eaac5f4db8c618dc0bcf0e116
4
- data.tar.gz: a242910252986cceed0538da545ac836eb139612
3
+ metadata.gz: 548a8eb24d08e24657164b8fa38253606ca3bc60
4
+ data.tar.gz: f9acba89db62acf88882f574cbe4525eb9036e1d
5
5
  SHA512:
6
- metadata.gz: a04b9a06342d7b0e09c129811d672ed4527987ea42aa69c336eae548403df770d6164894e12bea26f51877937df2ae4477c0e6aa3b6f6667f7b85f5e5a628487
7
- data.tar.gz: 7afe7429e2bb6cd1cbea1e6bdb043f56be3c23ed26e896694be14712cc2d0dce57c3981c387e84c6772ab977ca77d90ab5457cfdd881f56c9023bd99de7440fa
6
+ metadata.gz: f1a3033435ad4f41975440d38edd2bd607861353e3d13636eae30095e5eddc0bd50769cbf652317edc0fb695dce0e161bef131f29349a461da12713e4da5c05e
7
+ data.tar.gz: 228a0ead1be2601ca45d503b9329456f98862aa69af1ac5758f79738a1d89920467f392dd4fe4a2c7fc62339efcf607850d2b770c56b3cfd15b5775f95938294
@@ -62,10 +62,10 @@ angular.module('NgDrag', [])
62
62
  bool = false
63
63
  unless bool
64
64
  scope.setPosition(dragging,dropping,draggingContext,droppingContext,attributes.ngContext,factory,list_name)
65
- controller: ($scope, $element, $filter, $injector) ->
65
+ controller: ($scope, $element, $filter, $injector,$parse) ->
66
66
  $scope.setPosition = (dragging,dropping,draggingContext,droppingContext,context,factory,list_name) ->
67
67
  unless dragging == dropping
68
- orderedArray = $filter('orderBy')($scope[list_name], 'position')
68
+ orderedArray = $filter('orderBy')($parse(list_name)($scope), 'position')
69
69
  index = orderedArray.indexOf(dropping)
70
70
  unless dragging == orderedArray[index - 1]
71
71
  unless index == 0
@@ -0,0 +1,25 @@
1
+ angular.module('NgSortable', [])
2
+ .directive 'ngSortable', ($parse)->
3
+ template: (element) ->
4
+ '<span>' + element[0].innerHTML + '</span><i class="sort"></i>'
5
+ link: (scope,element,attributes) ->
6
+ scope.sortableField = (resource)->
7
+ return 'position' unless !!scope.howToSortField
8
+ scope.howToSortField(resource)
9
+ sortableFunc = $parse(attributes.ngSortable)
10
+ icon = element.find('i')
11
+ icon.bind 'click', ->
12
+ element.parent().find('i').removeClass('up')
13
+ element.parent().find('i').removeClass('down')
14
+ scope.$apply ->
15
+ if scope.howToSortField == sortableFunc
16
+ scope.sortableReverse = !scope.sortableReverse
17
+ else
18
+ scope.sortableReverse = false
19
+ scope.howToSortField = sortableFunc
20
+ if scope.sortableReverse == false
21
+ icon.addClass('down')
22
+ icon.removeClass('up')
23
+ else
24
+ icon.addClass('up')
25
+ icon.removeClass('down')
@@ -4,8 +4,12 @@ angular.module('TextArea', [])
4
4
  link: (scope, element, attributes) ->
5
5
  scope.initialHeight = scope.initialHeight || element[0].style.height
6
6
  element.css('resize','none').css('overflow','hidden').css('border','0px')
7
+ initial = element.parent().css('height')
7
8
  resize = ->
9
+ element.parent().css('height',element.parent()[0].offsetHeight)
8
10
  element[0].style.height = scope.initialHeight
9
11
  element[0].style.height = "" + Math.max(20,element[0].scrollHeight) + "px"
12
+ $timeout ->
13
+ element.parent().css('height',initial)
10
14
  element.on("blur keyup change", resize)
11
15
  $timeout(resize, 0)
@@ -61,3 +61,7 @@ Array.prototype.unique = (filterOn) ->
61
61
  break
62
62
  newItems.push(item) if (!isDuplicate)
63
63
  return newItems
64
+ String.prototype.to_f = ->
65
+ return parseFloat(this)
66
+ String.prototype.to_i = ->
67
+ return parseInt(this)
@@ -20,4 +20,5 @@ angular.module('materialRaingular', ['AutoComplete', 'NgDownload', 'NgChangeOnBl
20
20
  'NgRepeatList', 'NgUpdate', 'NgPopup', 'NgBoolean', 'Table', 'NgWatchShow', 'NgTrackBy'
21
21
  'NgUpload', 'NgDestroy', 'NgCreate', 'Video','NgAuthorize', 'TextArea', 'MdUpdate'
22
22
  'NgSlide', 'NgMatches','NgFade','NgSwipe', 'NgLoad', 'NgWatchContent', 'RailsUpdater'
23
- 'ngRoute', 'ngMaterial', 'ngMessages', 'ngResource', 'materialFilters', 'NgCallback'])
23
+ 'ngRoute', 'ngMaterial', 'ngMessages', 'ngResource', 'materialFilters', 'NgCallback'
24
+ 'NgSortable'])
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.0.2.6.6"
2
+ VERSION = "0.0.2.6.7"
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.2.6.6
4
+ version: 0.0.2.6.7
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-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -87,6 +87,7 @@ files:
87
87
  - lib/assets/javascripts/directives/ngpopup.js.coffee
88
88
  - lib/assets/javascripts/directives/ngrepeatlist.js.coffee
89
89
  - lib/assets/javascripts/directives/ngslide.js.coffee
90
+ - lib/assets/javascripts/directives/ngsortable.js.coffee
90
91
  - lib/assets/javascripts/directives/ngswipe.js.coffee
91
92
  - lib/assets/javascripts/directives/ngtrackby.coffee
92
93
  - lib/assets/javascripts/directives/ngupdate.js.coffee