sweetalert-rails 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 874cb28987e88129206cd764638eb5af23f6f1b8
4
- data.tar.gz: e32dbf0719aa7b892f5d8bf9da215b6f92d0cc4e
3
+ metadata.gz: 11886c139f6e0f47c1aa38e8715c858598ecf67b
4
+ data.tar.gz: 9015955248b262e9e0f2259da8e6c698f7c2ecf6
5
5
  SHA512:
6
- metadata.gz: 16092033322d78b529de17c11887e1f9bba3b13fef3db3a10451a9874b457d39c4569f49cb68278244c14b4dec8aa26e8081a699726d88317ecabfd8ccefd0d9
7
- data.tar.gz: 8cf08e710937f66c6782f89e4fd715a385e81ef1909badd1dcb3ace4b3ff97833f4662c145821cf56d2b8acb6468d1ad83e279ac6311019a96fbc28143f7d071
6
+ metadata.gz: 56e88bc878a7877fe71c79066b15ab7c1d3eeffdb07cca648720a882d52ac0e73b25ac716f3ced57f30717799bb03a14d13809114d88960e45fc36d66c4061fe
7
+ data.tar.gz: deb1a4522e7dc35b52cdfa60c559a47e0d23aecfbf7ba9b8cfa94dd3845c004187f6f476b8db4cef4ebef3eb207938a9a130b55d82b662de2693f7bed810f352
@@ -1,3 +1,3 @@
1
1
  module SweetAlert
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -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) {
@@ -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; }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sweetalert-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Sharshenov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-13 00:00:00.000000000 Z
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties