nail_polish 0.3.0 → 0.4.1
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 +4 -4
- data/app/assets/javascripts/nail_polish/templates/stackable_modal.mustache +6 -0
- data/app/assets/javascripts/nail_polish/widget/modal.js +12 -5
- data/app/assets/javascripts/nail_polish/widget/stackable_modal.js +24 -0
- data/app/assets/javascripts/nail_polish_widgets.js +1 -0
- data/app/assets/stylesheets/nail_polish/base/layout.scss +12 -0
- data/app/assets/stylesheets/nail_polish/base/widgets/modal.scss +1 -1
- data/lib/nail_polish/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dabaa91a6211c871b5dcccf0d4a79acd92c88e0c
|
|
4
|
+
data.tar.gz: 9a569ffeacf3a950aab6cd40152b5a16469156a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 17d5e8ca3bf3094b515e5a6687e6e3935da1735a53900952b07b58eafdcb10851cef16a5b127965a6f57bfbca5dab49fd9e5e26c4cefb5930cbab1271cdc3b02
|
|
7
|
+
data.tar.gz: 10b9242ce3a4f47a846682987159ae020912e6b7399cd6c1802445c61fd42e09c077c45104edb4c37abf2ac901bc72a6be8cf866ec3959cf8a99c86a4961f430
|
|
@@ -2,26 +2,28 @@ NailPolish.Widget.Modal = NailPolish.View.extend({
|
|
|
2
2
|
parent: 'body',
|
|
3
3
|
parentSelector: '#overlay-container',
|
|
4
4
|
attachmentMethod: 'html',
|
|
5
|
+
baseModalTemplateName: "nail_polish/templates/modal",
|
|
6
|
+
overlaySelector: "#overlay",
|
|
5
7
|
|
|
6
8
|
events: function () {
|
|
7
9
|
_.extend(this.addListeners, {
|
|
8
10
|
'click .close-modal': 'close',
|
|
9
|
-
'click .cancel-link a': 'close'
|
|
10
|
-
'click #overlay': 'verifyTargetAndClose'
|
|
11
|
+
'click .cancel-link a': 'close'
|
|
11
12
|
});
|
|
12
13
|
|
|
14
|
+
this.addListeners["click " + this.overlaySelector] = "verifyTargetAndClose";
|
|
13
15
|
return NailPolish.View.prototype.events.apply(this);
|
|
14
16
|
},
|
|
15
17
|
|
|
16
18
|
verifyTargetAndClose: function (e) {
|
|
17
|
-
if($(e.target).is(
|
|
19
|
+
if($(e.target).is(this.overlaySelector)) {
|
|
18
20
|
this.close();
|
|
19
21
|
}
|
|
20
22
|
},
|
|
21
23
|
|
|
22
24
|
renderTemplate: function () {
|
|
23
25
|
// switch declared template into a partial for consistent usage
|
|
24
|
-
var template = HoganTemplates[
|
|
26
|
+
var template = HoganTemplates[this.baseModalTemplateName];
|
|
25
27
|
var partials = _.extend(this.partials(), {
|
|
26
28
|
modal_content: HoganTemplates[this.templateName]
|
|
27
29
|
});
|
|
@@ -45,7 +47,8 @@ NailPolish.Widget.Modal = NailPolish.View.extend({
|
|
|
45
47
|
e.preventDefault(); // This is necessary to prevent clicking on elements behind the modal
|
|
46
48
|
}
|
|
47
49
|
NailPolish.Events.unsubscribe('page:new', this.close, this);
|
|
48
|
-
|
|
50
|
+
|
|
51
|
+
this.unfreezeBody();
|
|
49
52
|
this.remove();
|
|
50
53
|
this.onClose();
|
|
51
54
|
},
|
|
@@ -66,5 +69,9 @@ NailPolish.Widget.Modal = NailPolish.View.extend({
|
|
|
66
69
|
|
|
67
70
|
freezeBody: function() {
|
|
68
71
|
$('body').addClass('no-scroll');
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
unfreezeBody: function() {
|
|
75
|
+
$('body').removeClass('no-scroll');
|
|
69
76
|
}
|
|
70
77
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
NailPolish.Widget.StackableModal = NailPolish.Widget.Modal.extend({
|
|
2
|
+
parentSelector: "#stackable-overlay-container",
|
|
3
|
+
attachmentMethod: "append",
|
|
4
|
+
baseModalTemplateName: "nail_polish/templates/stackable_modal",
|
|
5
|
+
overlaySelector: ".overlay",
|
|
6
|
+
|
|
7
|
+
render: function() {
|
|
8
|
+
NailPolish.Widget.Modal.prototype.render.apply(this);
|
|
9
|
+
NailPolish.Widget.StackableModal.stackedModalsCount += 1;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
close: function (e) {
|
|
13
|
+
NailPolish.Widget.StackableModal.stackedModalsCount -= 1;
|
|
14
|
+
NailPolish.Widget.Modal.prototype.close.apply(this);
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
unfreezeBody: function() {
|
|
18
|
+
if (NailPolish.Widget.StackableModal.stackedModalsCount === 0) {
|
|
19
|
+
NailPolish.Widget.Modal.prototype.unfreezeBody.apply(this);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
NailPolish.Widget.StackableModal.stackedModalsCount = 0;
|
|
@@ -13,6 +13,18 @@ body {
|
|
|
13
13
|
background: transparent image-url('nail_polish/backgrounds/black-0_5.png') repeat;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
#stackable-overlay-container {
|
|
17
|
+
.overlay {
|
|
18
|
+
position: fixed;
|
|
19
|
+
overflow-y: scroll;
|
|
20
|
+
top: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
left: 0;
|
|
23
|
+
right: 0;
|
|
24
|
+
background: transparent url('nail_polish/backgrounds/black-0_5.png') repeat;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
#page {
|
|
17
29
|
background: $light-color image-url('nail_polish/backgrounds/light_bg.png') repeat;
|
|
18
30
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
margin: $spacing auto;
|
|
3
3
|
max-width: 300px;
|
|
4
4
|
position: relative;
|
|
5
|
-
z-index: 10100;
|
|
6
5
|
|
|
7
6
|
@include border-radius;
|
|
8
7
|
|
|
@@ -17,6 +16,7 @@
|
|
|
17
16
|
|
|
18
17
|
.close-icon {
|
|
19
18
|
background: transparent image-url('nail_polish/elements/close_icon.png') no-repeat;
|
|
19
|
+
cursor: pointer;
|
|
20
20
|
margin-top: $spacing;
|
|
21
21
|
height: 15px;
|
|
22
22
|
width: 15px;
|
data/lib/nail_polish/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nail_polish
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kane Baccigalupi
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2014-09-
|
|
13
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|
|
@@ -191,6 +191,7 @@ files:
|
|
|
191
191
|
- app/assets/javascripts/nail_polish/templates/dropdown.mustache
|
|
192
192
|
- app/assets/javascripts/nail_polish/templates/menu.mustache
|
|
193
193
|
- app/assets/javascripts/nail_polish/templates/modal.mustache
|
|
194
|
+
- app/assets/javascripts/nail_polish/templates/stackable_modal.mustache
|
|
194
195
|
- app/assets/javascripts/nail_polish/utils/subview_manager.js
|
|
195
196
|
- app/assets/javascripts/nail_polish/utils/text.js
|
|
196
197
|
- app/assets/javascripts/nail_polish/validator.js
|
|
@@ -201,6 +202,7 @@ files:
|
|
|
201
202
|
- app/assets/javascripts/nail_polish/widget/flash.js
|
|
202
203
|
- app/assets/javascripts/nail_polish/widget/menu.js
|
|
203
204
|
- app/assets/javascripts/nail_polish/widget/modal.js
|
|
205
|
+
- app/assets/javascripts/nail_polish/widget/stackable_modal.js
|
|
204
206
|
- app/assets/javascripts/nail_polish.js
|
|
205
207
|
- app/assets/javascripts/nail_polish_legacy_base.js
|
|
206
208
|
- app/assets/javascripts/nail_polish_modern_base.js
|