data-confirm-modal 1.6.2 → 1.6.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 +5 -5
- data/lib/data-confirm-modal/version.rb +1 -1
- data/vendor/assets/javascripts/data-confirm-modal.js +27 -22
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c9bc7acb32dac28c104e638a0801893d596d45ea874a06d96f206bd6993c7984
|
4
|
+
data.tar.gz: 7297704438cc52582a7a6549dd2f7c9539f3eacfbe5461477a66498f864415f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf8b6b409d8a7be071c1bd79233c44a5218ff5594fb1f8548109e92b18b5a5df9c08a3d8532b0862ee9b6c243a1a2d33defce8a8c7d1a08638e9f20db7713b02
|
7
|
+
data.tar.gz: f204f58dd28b34bc3fb0f0b38695f5793379d52978748b284559a08d4c5c8f83e4827ed33cc105e61c43dcc4fce7c25be2c5c858bef8d3f320144926bc6962ab
|
@@ -47,6 +47,7 @@
|
|
47
47
|
focus: 'commit',
|
48
48
|
zIndex: 1050,
|
49
49
|
modalClass: false,
|
50
|
+
modalCloseContent: '×',
|
50
51
|
show: true
|
51
52
|
};
|
52
53
|
|
@@ -116,23 +117,24 @@
|
|
116
117
|
|
117
118
|
var buildElementModal = function (element) {
|
118
119
|
var options = {
|
119
|
-
title:
|
120
|
-
text:
|
121
|
-
focus:
|
122
|
-
method:
|
123
|
-
modalClass:
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
120
|
+
title: element.data('title') || element.attr('title') || element.data('original-title'),
|
121
|
+
text: element.data('confirm'),
|
122
|
+
focus: element.data('focus'),
|
123
|
+
method: element.data('method'),
|
124
|
+
modalClass: element.data('modal-class'),
|
125
|
+
modalCloseContent: element.data('modal-close-content'),
|
126
|
+
commit: element.data('commit'),
|
127
|
+
commitClass: element.data('commit-class'),
|
128
|
+
cancel: element.data('cancel'),
|
129
|
+
cancelClass: element.data('cancel-class'),
|
130
|
+
remote: element.data('remote'),
|
131
|
+
verify: element.data('verify'),
|
132
|
+
verifyRegexp: element.data('verify-regexp'),
|
133
|
+
verifyLabel: element.data('verify-text'),
|
132
134
|
verifyRegexpCaseInsensitive: element.data('verify-regexp-caseinsensitive'),
|
133
|
-
backdrop:
|
134
|
-
keyboard:
|
135
|
-
show:
|
135
|
+
backdrop: element.data('backdrop'),
|
136
|
+
keyboard: element.data('keyboard'),
|
137
|
+
show: element.data('show')
|
136
138
|
};
|
137
139
|
|
138
140
|
var modal = buildModal(options);
|
@@ -152,8 +154,10 @@
|
|
152
154
|
var fade = settings.fade ? 'fade' : '';
|
153
155
|
var modalClass = options.modalClass ? options.modalClass : settings.modalClass;
|
154
156
|
|
157
|
+
var modalCloseContent = options.modalCloseContent ? options.modalCloseContent : settings.modalCloseContent;
|
158
|
+
var modalClose = '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">'+modalCloseContent+'</button>'
|
159
|
+
|
155
160
|
var modalTitle = '<h5 id="'+id+'Label" class="modal-title"></h5> '
|
156
|
-
var modalClose = '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
|
157
161
|
var modalHeader;
|
158
162
|
|
159
163
|
// Bootstrap 3 and 4 have different DOMs and different CSS. In B4, the
|
@@ -190,7 +194,8 @@
|
|
190
194
|
);
|
191
195
|
|
192
196
|
// Make sure it's always the top zindex
|
193
|
-
var highest
|
197
|
+
var highest, current;
|
198
|
+
highest = current = settings.zIndex;
|
194
199
|
$('.modal.in').not('#'+id).each(function() {
|
195
200
|
current = parseInt($(this).css('z-index'), 10);
|
196
201
|
if(current > highest) {
|
@@ -283,8 +288,8 @@
|
|
283
288
|
* Returns a modal already built for the given element or builds a new one,
|
284
289
|
* caching it into the element's `confirm-modal` data attribute.
|
285
290
|
*/
|
286
|
-
|
287
|
-
var modal = element.data('confirm-modal');
|
291
|
+
$.fn.getConfirmModal = function () {
|
292
|
+
var element = $(this), modal = element.data('confirm-modal');
|
288
293
|
|
289
294
|
if (!modal) {
|
290
295
|
modal = buildElementModal(element);
|
@@ -295,7 +300,7 @@
|
|
295
300
|
};
|
296
301
|
|
297
302
|
$.fn.confirmModal = function () {
|
298
|
-
var modal =
|
303
|
+
var modal = $(this).getConfirmModal();
|
299
304
|
|
300
305
|
modal.spawn();
|
301
306
|
|
@@ -319,7 +324,7 @@
|
|
319
324
|
var window_confirm = window.confirm;
|
320
325
|
|
321
326
|
$(document).delegate(settings.elements.join(', '), 'confirm', function() {
|
322
|
-
var
|
327
|
+
var modal = $(this).getConfirmModal();
|
323
328
|
|
324
329
|
if (!modal.is(':visible')) {
|
325
330
|
modal.spawn();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data-confirm-modal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcello Barnaba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -64,8 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: 1.3.6
|
66
66
|
requirements: []
|
67
|
-
|
68
|
-
rubygems_version: 2.5.2.1
|
67
|
+
rubygems_version: 3.0.3
|
69
68
|
signing_key:
|
70
69
|
specification_version: 4
|
71
70
|
summary: Use bootstrap modals with Rails' UJS data-confirm
|