marionette.modal 1.0.0.6 → 1.0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gruntfile.coffee +1 -1
- data/examples/vendor/backbone.js +189 -169
- data/examples/vendor/marionette.js +287 -161
- data/examples/vendor/underscore.js +210 -123
- data/lib/marionette.modal/version.rb +1 -1
- data/test/spec/backbone.marionette.modals.spec.js +46 -13
- data/test/src/backbone.marionette.modals.spec.coffee +13 -4
- metadata +1 -1
@@ -3,7 +3,7 @@
|
|
3
3
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
4
4
|
|
5
5
|
describe('Backbone.Marionette.Modals', function() {
|
6
|
-
var
|
6
|
+
var BackboneModal, MarionetteModal, layout, myLayout, _ref, _ref1, _ref2;
|
7
7
|
myLayout = {};
|
8
8
|
layout = (function(_super) {
|
9
9
|
__extends(layout, _super);
|
@@ -27,25 +27,25 @@
|
|
27
27
|
return layout;
|
28
28
|
|
29
29
|
})(Backbone.Marionette.Layout);
|
30
|
-
|
31
|
-
__extends(
|
30
|
+
BackboneModal = (function(_super) {
|
31
|
+
__extends(BackboneModal, _super);
|
32
32
|
|
33
|
-
function
|
34
|
-
_ref1 =
|
33
|
+
function BackboneModal() {
|
34
|
+
_ref1 = BackboneModal.__super__.constructor.apply(this, arguments);
|
35
35
|
return _ref1;
|
36
36
|
}
|
37
37
|
|
38
|
-
|
38
|
+
BackboneModal.prototype.viewContainer = 'div';
|
39
39
|
|
40
|
-
|
40
|
+
BackboneModal.prototype.cancelEl = '.close';
|
41
41
|
|
42
|
-
|
42
|
+
BackboneModal.prototype.submitEl = '.submit';
|
43
43
|
|
44
|
-
|
44
|
+
BackboneModal.prototype.template = function() {
|
45
45
|
return '<a id="id"></a><div></div><a class="close"></a><a class="submit"></a>';
|
46
46
|
};
|
47
47
|
|
48
|
-
|
48
|
+
BackboneModal.prototype.views = {
|
49
49
|
'click #id': {
|
50
50
|
view: function() {
|
51
51
|
return '<p>html</p>';
|
@@ -53,13 +53,46 @@
|
|
53
53
|
}
|
54
54
|
};
|
55
55
|
|
56
|
-
|
56
|
+
BackboneModal.prototype.cancel = function() {};
|
57
57
|
|
58
|
-
|
58
|
+
BackboneModal.prototype.submit = function() {};
|
59
59
|
|
60
|
-
return
|
60
|
+
return BackboneModal;
|
61
61
|
|
62
62
|
})(Backbone.Modal);
|
63
|
+
MarionetteModal = (function(_super) {
|
64
|
+
__extends(MarionetteModal, _super);
|
65
|
+
|
66
|
+
function MarionetteModal() {
|
67
|
+
_ref2 = MarionetteModal.__super__.constructor.apply(this, arguments);
|
68
|
+
return _ref2;
|
69
|
+
}
|
70
|
+
|
71
|
+
MarionetteModal.prototype.viewContainer = 'div';
|
72
|
+
|
73
|
+
MarionetteModal.prototype.cancelEl = '.close';
|
74
|
+
|
75
|
+
MarionetteModal.prototype.submitEl = '.submit';
|
76
|
+
|
77
|
+
MarionetteModal.prototype.template = function() {
|
78
|
+
return '<a id="id"></a><div></div><a class="close"></a><a class="submit"></a>';
|
79
|
+
};
|
80
|
+
|
81
|
+
MarionetteModal.prototype.views = {
|
82
|
+
'click #id': {
|
83
|
+
view: function() {
|
84
|
+
return '<p>html</p>';
|
85
|
+
}
|
86
|
+
}
|
87
|
+
};
|
88
|
+
|
89
|
+
MarionetteModal.prototype.cancel = function() {};
|
90
|
+
|
91
|
+
MarionetteModal.prototype.submit = function() {};
|
92
|
+
|
93
|
+
return MarionetteModal;
|
94
|
+
|
95
|
+
})(Marionette.Modal);
|
63
96
|
myLayout = new layout();
|
64
97
|
describe('#show', function() {
|
65
98
|
it('should stack a modal view', function() {
|
@@ -9,7 +9,7 @@ describe 'Backbone.Marionette.Modals', ->
|
|
9
9
|
selector: '#modals'
|
10
10
|
regionType: Backbone.Marionette.Modals
|
11
11
|
|
12
|
-
class
|
12
|
+
class BackboneModal extends Backbone.Modal
|
13
13
|
viewContainer: 'div'
|
14
14
|
cancelEl: '.close'
|
15
15
|
submitEl: '.submit'
|
@@ -19,7 +19,18 @@ describe 'Backbone.Marionette.Modals', ->
|
|
19
19
|
view: -> '<p>html</p>'
|
20
20
|
cancel: ->
|
21
21
|
submit: ->
|
22
|
-
|
22
|
+
|
23
|
+
class MarionetteModal extends Marionette.Modal
|
24
|
+
viewContainer: 'div'
|
25
|
+
cancelEl: '.close'
|
26
|
+
submitEl: '.submit'
|
27
|
+
template: -> '<a id="id"></a><div></div><a class="close"></a><a class="submit"></a>'
|
28
|
+
views:
|
29
|
+
'click #id':
|
30
|
+
view: -> '<p>html</p>'
|
31
|
+
cancel: ->
|
32
|
+
submit: ->
|
33
|
+
|
23
34
|
myLayout = new layout()
|
24
35
|
|
25
36
|
describe '#show', ->
|
@@ -29,14 +40,12 @@ describe 'Backbone.Marionette.Modals', ->
|
|
29
40
|
|
30
41
|
it 'should disable modals with zIndex < modal', ->
|
31
42
|
|
32
|
-
|
33
43
|
describe '#close', ->
|
34
44
|
it 'should only close the last modal', ->
|
35
45
|
myLayout.modals.close()
|
36
46
|
expect(myLayout.modals.zIndex).toBe(0)
|
37
47
|
|
38
48
|
it 'should enable the last modal', ->
|
39
|
-
|
40
49
|
|
41
50
|
describe '#closeAll', ->
|
42
51
|
it 'should close all the modals', ->
|