modalist 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 22c767c3d51582ac5b3456d42b3fe9fd39c7a8f203a8f7ec607cae7261f69d92
4
- data.tar.gz: fe9f856993aa39155ac3bbd943d06339897b8031157e0c47b9ff4cbf919c79e7
3
+ metadata.gz: 53028ebc1dacdef9d576a4e9f21061bd00172a9070b4c161554da6f5cddc06fa
4
+ data.tar.gz: e1dd7149960ad31054211201458406c48d7f17e35a9a848c572fff4828f04e24
5
5
  SHA512:
6
- metadata.gz: 570d30ce024f69ef5196e1b656e25145c753e78bb388d0be2aad17f56fad35fbb1d8ffbbcd8d635b3ad8d2e869c59f313fc4284160c587c85be123bafe10bcf6
7
- data.tar.gz: 836b7b51bb9c79e280e06cedd968f16a7ee8ff9847ab34028f0e52ed26bb57c379a6d3f3510106f17a934125c3c8820836c93c78203758d50ec9d8977ba2547b
6
+ metadata.gz: 5d7315cbca574bbb81d2b007516a1202ea3ea2bdb874008750d7a458edbe9a64237f363044e867ac382d7690f2ae265d0cba56514b29a45b6cf30432c802cbd0
7
+ data.tar.gz: 5b96ae247bad1b60dfd4642433e2fd75ef579add4d45946ad04d47a9829c451c7946a90454ba2ed1dbf6d3489a674457d4cdf3dacdf8e918b710ea027c626d0b
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 1.0.3 - 2018/01/07
8
+
9
+ * bugfixes
10
+ * fixed assets included with gem
11
+ * updated Modalist.js to 1.0.3
12
+
7
13
  ### 1.0.2 - 2018/01/06
8
14
 
9
15
  * bugfixes
@@ -1,5 +1,5 @@
1
1
  module Modalist
2
2
 
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
 
5
5
  end
@@ -1,6 +1,6 @@
1
1
  /**!
2
2
  * @fileOverview modalist.js - A powerful AJAX modal plugin extending iziModal
3
- * @version 1.0.0
3
+ * @version 1.0.3
4
4
  * @license
5
5
  * MIT License
6
6
  *
@@ -24,8 +24,9 @@
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  * SOFTWARE.
26
26
  */
27
- (function($) {
28
- var Modalist = new function(options) {
27
+ var Modalist;
28
+ $(document).on( 'ready turbolinks:load', function() {
29
+ Modalist = new function(options) {
29
30
 
30
31
  var defaults = {
31
32
  iziModal: {}
@@ -33,25 +34,28 @@
33
34
  options = $.extend( defaults, options );
34
35
 
35
36
  this.modal = $('#modalist');
36
- this.iziModal = $(Modalist.modal).iziModal(options.iziModal);
37
+ // this.iziModal = $(this.modal).iziModal(options.iziModal);
38
+ this.iziModal = $(this.modal).iziModal();
37
39
 
38
- $('.modalist--trigger').unbind('click');
39
- $('.modalist--trigger').click(function(event) {
40
+ $('.modalist--trigger').off('click');
41
+ $('.modalist--trigger').on( 'click', function(event) {
40
42
 
41
43
  event.preventDefault();
42
44
 
43
- var event = jQuery.Event('modalist:click'),
45
+ var e = jQuery.Event('modalist:click'),
44
46
  url = $(this).data('modalist-url') || $(this).attr('href'),
45
47
  form = $(this).data('modalist-form') || false,
46
48
  fullScreen = $(this).data('modalist-full-screen');
47
49
 
48
- event.target = $(this);
49
- event.data = { url: url };
50
- $(document).trigger(event);
50
+ e.target = $(this);
51
+ e.data = { url: url };
52
+ $(document).trigger(e);
51
53
 
52
54
  Modalist.reset();
53
55
  Modalist.fullScreen(fullScreen);
54
- Modalist.load( url, form );
56
+ Modalist.load( url, {
57
+ form: form
58
+ });
55
59
 
56
60
  });
57
61
 
@@ -66,7 +70,9 @@
66
70
 
67
71
  Modalist.reset();
68
72
  Modalist.fullScreen(options.fullScreen);
69
- Modalist.load( options.url, options.form );
73
+ Modalist.load( options.url, {
74
+ form: options.form
75
+ });
70
76
 
71
77
  };
72
78
 
@@ -102,7 +108,7 @@
102
108
  if (options.form) {
103
109
  $.ajax({
104
110
  url: $(options.form).attr('action'),
105
- type: 'GET',
111
+ type: $(options.form).attr('method'),
106
112
  data : $(options.form).serialize(),
107
113
  success: function(data) {
108
114
  $(document).trigger('modalist:request-end');
@@ -134,4 +140,4 @@
134
140
  };
135
141
 
136
142
  };
137
- })(jQuery);
143
+ });
@@ -0,0 +1,27 @@
1
+ /**!
2
+ * @fileOverview modalist.js - A powerful AJAX modal plugin extending iziModal
3
+ * @version 1.0.3
4
+ * @license
5
+ * MIT License
6
+ *
7
+ * Copyright (c) 2017 Jonas Hübotter
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+ var Modalist;$(document).on("ready turbolinks:load",function(){Modalist=new function(a){var b={iziModal:{}};a=$.extend(b,a);this.modal=$("#modalist");this.iziModal=$(this.modal).iziModal();$(".modalist--trigger").off("click");$(".modalist--trigger").on("click",function(g){g.preventDefault();var h=jQuery.Event("modalist:click"),c=$(this).data("modalist-url")||$(this).attr("href"),f=$(this).data("modalist-form")||false,d=$(this).data("modalist-full-screen");h.target=$(this);h.data={url:c};$(document).trigger(h);Modalist.reset();Modalist.fullScreen(d);Modalist.load(c,{form:f})});this.open=function(c){var d={url:null,form:false,fullScreen:false};c=$.extend(d,c);Modalist.reset();Modalist.fullScreen(c.fullScreen);Modalist.load(c.url,{form:c.form})};this.close=function(){$(Modalist.modal).iziModal("close")};this.reset=function(){$(Modalist.modal).iziModal("setTransitionIn","comingIn");$(Modalist.modal).iziModal("setTransitionOut","comingOut");$(Modalist.modal).data("full-screen",false);$(Modalist.modal).iziModal("setTop","auto");$(Modalist.modal).iziModal("setBottom","auto")};this.fullScreen=function(c){if(c=="true"||(c=="mobile"&&$(window).width()<=800)){$(Modalist.modal).iziModal("setTransitionIn","fadeInRight");$(Modalist.modal).iziModal("setTransitionOut","fadeOutRight");$(Modalist.modal).data("full-screen",true)}};this.load=function(d,c){var e={form:false};c=$.extend(e,c);$(document).trigger("modalist:request-start");if(c.form){$.ajax({url:$(c.form).attr("action"),type:$(c.form).attr("method"),data:$(c.form).serialize(),success:function(f){$(document).trigger("modalist:request-end");Modalist.data(f)}})}else{$.get(d,function(f){$(document).trigger("modalist:request-end");Modalist.data(f)})}};this.data=function(c){$(document).trigger("modalist:before-render");$(Modalist.modal).find(".iziModal-content").html(c);$(document).trigger("modal:render");$(Modalist.modal).iziModal("open");if($(Modalist.modal).height()+60>$(window).height()){$(Modalist.modal).iziModal("setTop",30);$(Modalist.modal).iziModal("setBottom",30)}$(document).trigger("modalist:load")}}});
@@ -0,0 +1,112 @@
1
+ /**!
2
+ * @fileOverview modalist.js - A powerful AJAX modal plugin extending iziModal
3
+ * @version 1.0.0
4
+ * @license
5
+ * MIT License
6
+ *
7
+ * Copyright (c) 2017 Jonas Hübotter
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+ #modalist.iziModal
28
+ box-shadow: 0 .0625em .3125em 0 rgba(#657786, .05)
29
+ border: .0625rem solid #DCE2E7
30
+ border-radius: .3125rem !important
31
+ max-width: 90% !important
32
+ width: 37.5rem
33
+ // temporarily fixing height resizing
34
+ transition: margin-top .25s ease-out !important
35
+ &::after
36
+ content: none
37
+ &[data-full-screen="true"]
38
+ max-width: 100% !important
39
+ width: 100%
40
+ border-radius: 0 !important
41
+ border: none
42
+ height: 100vh !important
43
+ &.fadeInRight
44
+ animation: modalist-fadeInRight .35s ease-out !important
45
+ &.fadeOutRight
46
+ animation: modalist-fadeOutRight .35s ease-out !important
47
+ ::-webkit-scrollbar
48
+ width: .3125rem
49
+ ::-webkit-scrollbar-track
50
+ background: transparent
51
+ ::-webkit-scrollbar-thumb
52
+ border-radius: .15625rem
53
+ background: #DCE2E7
54
+ ::-webkit-scrollbar-thumb:hover
55
+ background: #bec7cf
56
+ & > .iziModal-wrap
57
+ border-radius: .3125rem
58
+ border-bottom: .0625rem solid #DCE2E7
59
+ & > .iziModal-content
60
+ & > .modalist--header
61
+ background: #FCFCFC
62
+ border-radius: .3125rem .3125rem 0 0
63
+ display: flex
64
+ align-items: center
65
+ justify-content: space-between
66
+ padding: 1.25rem
67
+ border-bottom: .0625rem solid #DCE2E7
68
+ h4, p
69
+ margin: 0
70
+ h4
71
+ line-height: 1.58
72
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"
73
+ font-weight: 600
74
+ font-size: 1.125rem
75
+ color: #14171A
76
+ @media (min-width: 800px)
77
+ font-size: 1.25rem
78
+ p
79
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"
80
+ color: #3d4553
81
+ font-weight: normal
82
+ letter-spacing: -.003em
83
+ font-size: .875rem
84
+ line-height: 1.75
85
+ @media (min-width: 800px)
86
+ font-size: 1rem
87
+ .modalist--close
88
+ display: flex
89
+ align-items: center
90
+ justify-content: center
91
+ opacity: .85
92
+ &:hover, &:focus
93
+ opacity: 1
94
+ & > .modalist--content
95
+ background: white
96
+ border-radius: .3125rem
97
+ padding: 1.25rem
98
+ .iziModal-overlay
99
+ background: transparentize(#E7ECF0, 0.13) !important
100
+ #modalist.iziModal, .iziModal-overlay
101
+ animation-duration: .5s !important
102
+
103
+ @keyframes modalist-fadeInRight
104
+ from
105
+ transform: translateX(100%)
106
+ to
107
+ transform: none
108
+ @keyframes modalist-fadeOutRight
109
+ from
110
+ transform: none
111
+ to
112
+ transform: translateX(100%)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modalist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Hübotter
@@ -86,13 +86,14 @@ files:
86
86
  - lib/modalist/engine.rb
87
87
  - lib/modalist/railtie.rb
88
88
  - lib/modalist/version.rb
89
- - vendor/javascripts/iziModal.js
90
- - vendor/javascripts/iziModal.min.js
91
- - vendor/javascripts/modalist.js
92
- - vendor/javascripts/modalist.min.js
93
- - vendor/stylesheets/iziModal.css
94
- - vendor/stylesheets/iziModal.min.css
95
- - vendor/stylesheets/modailst.min.css
89
+ - vendor/assets/javascripts/iziModal.js
90
+ - vendor/assets/javascripts/iziModal.min.js
91
+ - vendor/assets/javascripts/modalist.js
92
+ - vendor/assets/javascripts/modalist.min.js
93
+ - vendor/assets/stylesheets/iziModal.css
94
+ - vendor/assets/stylesheets/iziModal.min.css
95
+ - vendor/assets/stylesheets/modailst.min.css
96
+ - vendor/assets/stylesheets/modalist.sass
96
97
  homepage: https://github.com/jonhue/modalist
97
98
  licenses:
98
99
  - MIT
@@ -1,27 +0,0 @@
1
- /**!
2
- * @fileOverview modalist.js - A powerful AJAX modal plugin extending iziModal
3
- * @version 1.0.0
4
- * @license
5
- * MIT License
6
- *
7
- * Copyright (c) 2017 Jonas Hübotter
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in all
17
- * copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- * SOFTWARE.
26
- */
27
- (function(b){var a=new function(c){var d={iziModal:{}};c=b.extend(d,c);this.modal=b("#modalist");this.iziModal=b(a.modal).iziModal(c.iziModal);b(".modalist--trigger").unbind("click");b(".modalist--trigger").click(function(h){h.preventDefault();var h=jQuery.Event("modalist:click"),e=b(this).data("modalist-url")||b(this).attr("href"),g=b(this).data("modalist-form")||false,f=b(this).data("modalist-full-screen");h.target=b(this);h.data={url:e};b(document).trigger(h);a.reset();a.fullScreen(f);a.load(e,g)});this.open=function(e){var f={url:null,form:false,fullScreen:false};e=b.extend(f,e);a.reset();a.fullScreen(e.fullScreen);a.load(e.url,e.form)};this.close=function(){b(a.modal).iziModal("close")};this.reset=function(){b(a.modal).iziModal("setTransitionIn","comingIn");b(a.modal).iziModal("setTransitionOut","comingOut");b(a.modal).data("full-screen",false);b(a.modal).iziModal("setTop","auto");b(a.modal).iziModal("setBottom","auto")};this.fullScreen=function(e){if(e=="true"||(e=="mobile"&&b(window).width()<=800)){b(a.modal).iziModal("setTransitionIn","fadeInRight");b(a.modal).iziModal("setTransitionOut","fadeOutRight");b(a.modal).data("full-screen",true)}};this.load=function(f,e){var g={form:false};e=b.extend(g,e);b(document).trigger("modalist:request-start");if(e.form){b.ajax({url:b(e.form).attr("action"),type:"GET",data:b(e.form).serialize(),success:function(h){b(document).trigger("modalist:request-end");a.data(h)}})}else{b.get(f,function(h){b(document).trigger("modalist:request-end");a.data(h)})}};this.data=function(e){b(document).trigger("modalist:before-render");b(a.modal).find(".iziModal-content").html(e);b(document).trigger("modal:render");b(a.modal).iziModal("open");if(b(a.modal).height()+60>b(window).height()){b(a.modal).iziModal("setTop",30);b(a.modal).iziModal("setBottom",30)}b(document).trigger("modalist:load")}}})(jQuery);