thin_man 0.20.7 → 0.20.8

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
  SHA256:
3
- metadata.gz: 9f14546b73fd65c440fe329c8ad0a3965d31483661266439d7b33924f6ed3400
4
- data.tar.gz: 3a86b97d1e6af62d6856d137921bff56effc66c2c25d77708466fadee4494f36
3
+ metadata.gz: 785077cef9f4272c5ef085fd46a0fff922f2948f38b0bd3d35f09f52e2eaeac5
4
+ data.tar.gz: 7aea9de5c7bf16ecc9e0de2be2ebb9a368b73b16943b26362675664c33930918
5
5
  SHA512:
6
- metadata.gz: 0b22b547ca991d78621809dc346adc04c062009bcc8946b2349869c4860dd13ff9c326854dc6b3050e3e09d52b7609ec3094345b24aaa148345b160b5f76b2e0
7
- data.tar.gz: 56eb860f19ebfc88fa0318ef085a978b5f26394c8c0b08cdecb127bfbf341e6020f870d451ce538bc5c4e5e91f97781826cf638d4810745ca53837d011ad0b3a
6
+ metadata.gz: a01759d57c9c137c5520373f2d314c8e6a3697167e5d97be18f2750dd6cda7464b2dce872394d7a952df868f98461dcb968457ec048030f78181f3524bb78a54
7
+ data.tar.gz: 91589300a0b542377d987f37fd38d7bed4c3d25f0dc2a6c61fc447f65d52130f9dda18ca5045cd780c49a4f8520a0d64f1fb93ac87c826c88f533906d1e00938
@@ -75,7 +75,8 @@ var initThinMan = function() {
75
75
  this.getErrorTarget()
76
76
  this.progress_color = jq_obj.data('progress-color')
77
77
  this.progress_target = $(jq_obj.data('progress-target'))
78
- this.$mask_target = $(jq_obj.data('mask-target'))
78
+ this.mask_target = jq_obj.data('mask-target')
79
+ if(this.mask_target){this.$mask_target = $(this.mask_target)}
79
80
  this.$mask_message = jq_obj.data('mask-message')
80
81
  this.custom_progress = typeof(jq_obj.data('custom-progress')) != 'undefined';
81
82
  this.scroll_to = jq_obj.data('scroll-to')
@@ -520,31 +521,51 @@ var initThinMan = function() {
520
521
  }
521
522
  }),
522
523
  AjaxMask: Class.extend({
523
- init: function($mask_target, mask_message) {
524
- var uuid = new UUID;
525
- this.$mask_target = $mask_target
526
- this.$mask = $('#thin_man_mask').clone()
527
- this.$mask.prop('id', 'thin_man_mask' + uuid.value)
528
- if (typeof mask_message != 'undefined') {
529
- var $message = this.$mask.find('[data-thin-man-mask-message]')
530
- $message.html(mask_message)
531
- }
532
- var height = this.$mask_target.outerHeight()
533
- var width = this.$mask_target.outerWidth()
534
- var radius = this.$mask_target.css('border-radius')
535
- this.$mask.css({ 'height': height, 'width': width, 'left': 0, 'top': 0, 'border-radius': radius })
536
- this.$mask.css({ 'position': 'absolute', 'z-index': 10000 })
524
+ init: function($mask_target, mask_message) {
525
+ var uuid = new UUID;
526
+ this.$mask_target = $mask_target
527
+ this.$mask = $('#thin_man_mask').clone()
528
+ this.$mask.prop('id', 'thin_man_mask' + uuid.value)
529
+ if (typeof mask_message != 'undefined') {
530
+ var $message = this.$mask.find('[data-thin-man-mask-message]')
531
+ $message.html(mask_message)
532
+ }
533
+ var height = this.$mask_target.outerHeight()
534
+ var width = this.$mask_target.outerWidth()
535
+ var radius = this.$mask_target.css('border-radius')
536
+ this.$mask.css({ 'height': height, 'width': width, 'left': 0, 'top': 0, 'border-radius': radius })
537
+ this.$mask.css({ 'position': 'absolute', 'z-index': 10000 })
537
538
 
538
- this.$mask_target.append(this.$mask)
539
- this.$mask.on('click mousedown mousemove', function(e) {
540
- e.preventDefault();
541
- return false;
542
- })
543
- this.$mask.show()
544
- },
545
- remove: function() {
546
- this.$mask.remove()
547
- }
539
+ this.$mask_target.append(this.$mask)
540
+
541
+ this.disableScroll()
542
+ this.arrangeContent()
543
+ },
544
+ arrangeContent: function(){
545
+ this.$mask.css({'max-height': window.innerHeight})
546
+ this.$mask.show()
547
+ },
548
+ disableScroll: function(){
549
+ if($(window).width() >= 640){
550
+ var mask = this
551
+ mask.old_height = $('body')[0].style.height
552
+ mask.old_overflow = $('body')[0].style.overflow
553
+ $('body').css({height: '100%',overflow: 'hidden'})
554
+ } else {
555
+ $('body').children().not('.ajax-mask-public').hide()
556
+ }
557
+ },
558
+ enableScroll: function(){
559
+ if($(window).width() >= 640){
560
+ $('body').css({height: this.old_height, overflow: this.old_overflow})
561
+ } else {
562
+ $('body').children().not('#ajax-mask-public').show()
563
+ }
564
+ },
565
+ remove: function() {
566
+ this.enableScroll()
567
+ this.$mask.remove()
568
+ }
548
569
  }),
549
570
  AjaxFlash: Class.extend({
550
571
  init: function(type, message, elem, duration) {
@@ -1,3 +1,3 @@
1
1
  module ThinMan
2
- VERSION = "0.20.7"
2
+ VERSION = "0.20.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.7
4
+ version: 0.20.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut, Adam Bialek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-15 00:00:00.000000000 Z
11
+ date: 2019-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails