sweet-alert 0.0.5 → 0.0.6

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: d92f1e1869ae8edc75cf4cbd1b8eebf72def3a17
4
- data.tar.gz: 388395f7322b9c1a4e4d9b390c949720e3042494
3
+ metadata.gz: 2496a19e486c4e0d910addeeae63f5903b4ff4e3
4
+ data.tar.gz: 1d2bb9e339ba8860ff7831b0f220be63a201f13b
5
5
  SHA512:
6
- metadata.gz: 6d2dfc24a803e5e834027bd6f721ba708867e2724b27a7e0099d8912093483bb758d5d5bd10f5715e50f4ceca3f2bfc73858e0415cc84c1f5ee9d7ff3e9b4d88
7
- data.tar.gz: 1caa844bf4c89dbf3dac78af2da8d57b63b4b83424df8a4270089b7548833e9008228f398f81d4891d129de4387706a0a05ea47980a211caa2f924692c33454f
6
+ metadata.gz: 7b0ac5465d2d1b859a8161e2924d84cdca2e43eba22f48eb55598517ffca3db1cbc7a061d5d40f78db537e31503488021d621860754578293c3aeb54feb6e387
7
+ data.tar.gz: 3db817086e0ec1ef6d370c44aa23b2d646cf454c18a3050fe077ff041ed02aa93c47ec6c52a5be9130d0424b02ad796c84863c57ee0371be7dc5741aa27a910a
data/.gitignore CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
@@ -196,6 +196,24 @@
196
196
  */
197
197
 
198
198
  window.sweetAlert = window.swal = function() {
199
+ // Copy arguments to the local args variable
200
+ var args = arguments;
201
+ if (getModal() !== null) {
202
+ // If getModal returns values then continue
203
+ modalDependant.apply(this, args);
204
+ } else {
205
+ // If getModal returns null i.e. no matches, then set up a interval event to check the return value until it is not null
206
+ var modalCheckInterval = setInterval(function() {
207
+ if (getModal() !== null) {
208
+ clearInterval(modalCheckInterval);
209
+ modalDependant.apply(this, args);
210
+ }
211
+ }, 100);
212
+ }
213
+ };
214
+
215
+ function modalDependant() {
216
+
199
217
  if (arguments[0] === undefined) {
200
218
  window.console.error('sweetAlert expects at least 1 attribute!');
201
219
  return false;
@@ -221,6 +239,7 @@
221
239
  params.title = arguments[0].title;
222
240
  params.text = arguments[0].text || defaultParams.text;
223
241
  params.type = arguments[0].type || defaultParams.type;
242
+ params.customClass = arguments[0].customClass || params.customClass;
224
243
  params.allowOutsideClick = arguments[0].allowOutsideClick || defaultParams.allowOutsideClick;
225
244
  params.showCancelButton = arguments[0].showCancelButton !== undefined ? arguments[0].showCancelButton : defaultParams.showCancelButton;
226
245
  params.closeOnConfirm = arguments[0].closeOnConfirm !== undefined ? arguments[0].closeOnConfirm : defaultParams.closeOnConfirm;
@@ -459,7 +478,7 @@
459
478
  }
460
479
  }, 0);
461
480
  };
462
- };
481
+ }
463
482
 
464
483
  /**
465
484
  * Set default params for each popup
@@ -497,6 +516,11 @@
497
516
  show($text);
498
517
  }
499
518
 
519
+ //Custom Class
520
+ if (params.customClass) {
521
+ addClass(modal, params.customClass);
522
+ }
523
+
500
524
  // Icon
501
525
  hide(modal.querySelectorAll('.icon'));
502
526
  if (params.type) {
File without changes
@@ -40,7 +40,7 @@
40
40
  position: relative;
41
41
  margin: 25px 0;
42
42
  padding: 0;
43
- line-height: 25px;
43
+ line-height: 40px;
44
44
  display: block; }
45
45
  .sweet-alert p {
46
46
  color: #797979;
@@ -48,6 +48,8 @@
48
48
  text-align: center;
49
49
  font-weight: 300;
50
50
  position: relative;
51
+ text-align: inherit;
52
+ float: none;
51
53
  margin: 0;
52
54
  padding: 0;
53
55
  line-height: normal; }
@@ -56,7 +56,7 @@
56
56
  position: relative;
57
57
  margin: 25px 0;
58
58
  padding: 0;
59
- line-height: 25px;
59
+ line-height: 40px;
60
60
  display: block;
61
61
  }
62
62
 
@@ -66,6 +66,8 @@
66
66
  text-align: center;
67
67
  font-weight: 300;
68
68
  position: relative;
69
+ text-align: inherit;
70
+ float: none;
69
71
  margin: 0;
70
72
  padding: 0;
71
73
  line-height: normal;
data/lib/sweet-alert.rb CHANGED
File without changes
File without changes
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'sweet-alert'
6
- s.version = '0.0.5'
6
+ s.version = '0.0.6'
7
7
  s.summary = "The awesome replacement for Javascript's alert"
8
8
  s.authors = ["Najtmare"]
9
9
  s.email = 'millan@sino.net'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sweet-alert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Najtmare
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-15 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: millan@sino.net
@@ -16,7 +16,7 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - ".gitignore"
19
+ - .gitignore
20
20
  - Gemfile
21
21
  - LICENSE
22
22
  - README.md
@@ -39,17 +39,17 @@ require_paths:
39
39
  - lib
40
40
  required_ruby_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - '>='
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
47
+ - - '>='
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  requirements: []
51
51
  rubyforge_project:
52
- rubygems_version: 2.2.2
52
+ rubygems_version: 2.0.2
53
53
  signing_key:
54
54
  specification_version: 4
55
55
  summary: The awesome replacement for Javascript's alert