dlegr250_material_design 0.4.81 → 0.4.82

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: 9ff14c237e3230c31b81eef338b68a7165bc1d20
4
- data.tar.gz: 1cf725891490cedff3df7ca95aad02c7e18e090e
3
+ metadata.gz: 40018e1e2d6d8c5eb32d0a86cff8c354d385842e
4
+ data.tar.gz: b932b6392665423344f49c78898a8644e0ac24c3
5
5
  SHA512:
6
- metadata.gz: 4652d03c37d1b94964e9bb0c3f811bef9dae197cfc30f180c822a3de81963229959949f0ad0b3c923a6beab9cc7c3ed6e77ef617257c1ebb87f6c85f664a7cab
7
- data.tar.gz: c3f5e93eef631e6bb975022a62d6c2debb4296c49808f5225c791ed7fbcb4fc9769d58023fbf24c9840d418e83ba2991848d68c2eca88c30b3ba529f3c1adfcd
6
+ metadata.gz: 9ded4096ac3245a5d240d38f04949f900c23c58d3ea5581a67e9346348233a5c929a958219947fc115b49a491ed996a89a72498213ed3f3af647583ec725cb81
7
+ data.tar.gz: 3022cb73d191af687961f977d3a8cc3d70da9f485117ebba7eb91c9c1968c334d39c199646c616f1a35fe2f67adbf7b6a50c354936e842a8ad350b88ee8bcb4b
@@ -1,3 +1,3 @@
1
1
  module Dlegr250MaterialDesign
2
- VERSION = "0.4.81"
2
+ VERSION = "0.4.82"
3
3
  end
@@ -6,50 +6,97 @@
6
6
  #======================================================================
7
7
  class App.MD.Dialog
8
8
  @init: () ->
9
- @setVariables()
10
9
  @setEvents()
11
10
 
12
- @setVariables: () ->
13
- @$dialog = $("#dialog")
14
-
15
11
  @setEvents: () ->
16
- $("body").on "click", "a[data-custom-confirm]", (event) =>
17
- $trigger = $(event.target).closest("a[data-custom-confirm]")
12
+ $("body").on "click", "a[data-custom-confirm]", (e) =>
13
+ $trigger = $(e.target).closest("a[data-custom-confirm]")
18
14
  $triggerTemplateId = $trigger.data("custom-confirm")["template"]
19
15
  $triggerLinkClone = $trigger.clone().removeAttr("data-custom-confirm")
20
16
  $triggerLinkClone.attr("id", "dialog-trigger-original-link")
21
17
 
22
- # Replace dialog content with trigger template
23
- $templateHtml = $("##{$triggerTemplateId}").html()
24
- @$dialog.html($templateHtml)
18
+ $dialog = $($("##{$triggerTemplateId}").html())
25
19
 
26
20
  # Copy over original link to dialog
27
- @$dialog.find(".dialog-actions").append($triggerLinkClone.hide())
21
+ $dialog.find(".dialog-actions").append($triggerLinkClone.hide())
22
+ @.showDialog($dialog)
28
23
 
29
- @.showDialog()
30
- false
24
+ $("body").on "click", "[role='dialog-close']", (e) ->
25
+ $dialog = $(this).parents(".dialog-container")
26
+ App.MD.Dialog.hideDialog($dialog)
31
27
 
32
- @$dialog.on "click", "[role='cancel']", =>
33
- @.hideDialog()
34
- false
28
+ $("body").on "click", "[role='dialog-confirm']", (e) ->
29
+ $dialog = $(this).parents(".dialog-container")
30
+ $dialog.find("#dialog-trigger-original-link").click()
31
+ App.MD.Dialog.hideDialog($dialog)
35
32
 
36
- @$dialog.on "click", "[role='confirm']", =>
37
- @$dialog.find("#dialog-trigger-original-link").click()
38
- @.hideDialog()
33
+ @call: (html) ->
34
+ $dialog = $(html)
35
+ @.showDialog($dialog)
39
36
 
40
- @call: (html_content) ->
41
- @$dialog.html(html_content)
42
- @.showDialog()
37
+ @showDialog: (element) ->
38
+ element = $(element)
39
+ App.MD.Menus.hideMenus()
40
+ $("body").append(element)
41
+ element.hide().show()
42
+ element.addClass("visible")
43
+ element.find("input[autofocus]").focus()
44
+ false
43
45
 
44
- @isVisible: () ->
45
- @$dialog.hasClass("visible")
46
+ @hideDialog: (element) ->
47
+ element.removeClass("visible")
48
+ window.setTimeout =>
49
+ element.remove()
50
+ , 500
51
+ false
46
52
 
47
- @showDialog: () ->
48
- App.MD.Layout.showOverlay()
49
- App.MD.Menus.hideMenus()
50
- @$dialog.addClass("visible")
51
53
 
52
- @hideDialog: () ->
53
- @$dialog.removeClass("visible")
54
- if App.MD.Layout.isOverlayVisible()
55
- App.MD.Layout.hideOverlay()
54
+ # class App.MD.Dialog
55
+ # @init: () ->
56
+ # @setVariables()
57
+ # @setEvents()
58
+ #
59
+ # @setVariables: () ->
60
+ # @$dialog = $("#dialog")
61
+ #
62
+ # @setEvents: () ->
63
+ # $("body").on "click", "a[data-custom-confirm]", (event) =>
64
+ # $trigger = $(event.target).closest("a[data-custom-confirm]")
65
+ # $triggerTemplateId = $trigger.data("custom-confirm")["template"]
66
+ # $triggerLinkClone = $trigger.clone().removeAttr("data-custom-confirm")
67
+ # $triggerLinkClone.attr("id", "dialog-trigger-original-link")
68
+ #
69
+ # # Replace dialog content with trigger template
70
+ # $templateHtml = $("##{$triggerTemplateId}").html()
71
+ # @$dialog.html($templateHtml)
72
+ #
73
+ # # Copy over original link to dialog
74
+ # @$dialog.find(".dialog-actions").append($triggerLinkClone.hide())
75
+ #
76
+ # @.showDialog()
77
+ # false
78
+ #
79
+ # @$dialog.on "click", "[role='cancel']", =>
80
+ # @.hideDialog()
81
+ # false
82
+ #
83
+ # @$dialog.on "click", "[role='confirm']", =>
84
+ # @$dialog.find("#dialog-trigger-original-link").click()
85
+ # @.hideDialog()
86
+ #
87
+ # @call: (html_content) ->
88
+ # @$dialog.html(html_content)
89
+ # @.showDialog()
90
+ #
91
+ # @isVisible: () ->
92
+ # @$dialog.hasClass("visible")
93
+ #
94
+ # @showDialog: () ->
95
+ # App.MD.Layout.showOverlay()
96
+ # App.MD.Menus.hideMenus()
97
+ # @$dialog.addClass("visible")
98
+ #
99
+ # @hideDialog: () ->
100
+ # @$dialog.removeClass("visible")
101
+ # if App.MD.Layout.isOverlayVisible()
102
+ # App.MD.Layout.hideOverlay()
@@ -55,7 +55,7 @@ class App.MD.Layout
55
55
  @hideOverlay: () ->
56
56
  @$sidebars.removeClass("visible")
57
57
  @$overlay.removeClass("visible")
58
- App.MD.Dialog.hideDialog()
58
+ # App.MD.Dialog.hideDialog()
59
59
 
60
60
  @isOverlayVisible: () ->
61
61
  @$overlay.hasClass("visible")
@@ -1,30 +1,61 @@
1
+ // Dialogs - container
2
+ //----------------------------------------------------------------------
3
+
4
+ .dialog-container {
5
+ background-color: rgba(0, 0, 0, 0.6);
6
+ box-sizing: border-box;
7
+ height: 100%;
8
+ left: 0;
9
+ position: fixed;
10
+ pointer-events: none;
11
+ top: 0;
12
+ width: 100%;
13
+ will-change: scale, opacity;
14
+ z-index: $overlay-depth;
15
+ @include flex-center();
16
+ @include no-touch-highlight;
17
+ @include transform(scale(1.15));
18
+ @include transition(all 0.10s cubic-bezier(0, 0, 0.3, 1));
19
+ @include transparency(0);
20
+
21
+ &.visible {
22
+ pointer-events: auto;
23
+ @include transform(scale(1.0));
24
+ @include transition(all 0.10s cubic-bezier(0, 0, 0.3, 1));
25
+ @include transparency(1.0);
26
+ }
27
+ }
28
+
1
29
  // Dialogs - base
2
30
  //----------------------------------------------------------------------
3
31
 
4
32
  .dialog {
5
33
  background: color("white");
6
34
  cursor: default;
7
- display: inline-block;
8
- margin: auto;
9
35
  max-width: 90%;
10
- pointer-events: none;
11
- position: relative;
12
- visibility: hidden;
13
- width: 500px; // max-width above caps this
14
- will-change: scale, transparency;
15
36
  z-index: $dialog-depth;
16
- @include box-shadow(0 12px 15px 0 rgba(0,0,0,0.24));
17
37
  @include rounded-corners;
18
- @include transition(all 0.10s ease);
19
- @include transform(scale(1.15));
20
- @include transparency(0);
38
+ }
21
39
 
22
- &.visible {
23
- pointer-events: auto;
24
- visibility: visible;
25
- @include transform(scale(1.0));
26
- @include transparency(1);
27
- @include transition(all 0.30s ease);
40
+ // Full-screen dialogs take up entire screen on small sizes
41
+ .dialog-full-screen {
42
+ height: 100%;
43
+ left: 0;
44
+ max-width: 100%;
45
+ position: absolute;
46
+ top: 0;
47
+ width: 100%;
48
+ @include rounded-corners(0);
49
+ }
50
+
51
+ @media (min-width: $small-width) {
52
+ .dialog {
53
+ height: auto;
54
+ max-width: 90%;
55
+ width: 500px;
56
+ position: relative;
57
+ @include box-shadow(0 12px 15px 0 rgba(0,0,0,0.24));
58
+ @include rounded-corners;
28
59
  }
29
60
  }
30
61
 
@@ -33,13 +64,26 @@
33
64
 
34
65
  .dialog-header {
35
66
  @include list-item();
36
- min-height: 0;
37
- padding: $spacing-large;
38
- padding-bottom: 20px;
67
+ min-height: $appbar-height;
68
+ // padding: 0 $spacing-normal;
69
+ }
70
+
71
+ .dialog-header-bordered {
72
+ border-bottom: 1px solid color("divider");
73
+ margin-bottom: $spacing-normal;
39
74
  }
40
75
 
41
76
  .dialog-header-icon {
42
77
  @include list-item-icon();
78
+ margin-right: $spacing-normal;
79
+
80
+ // To match up with .appbar-button
81
+ .button-icon {
82
+ font-size: $font-size-icon;
83
+ height: $appbar-button-height;
84
+ line-height: $appbar-button-height;
85
+ width: $appbar-button-height;
86
+ }
43
87
  }
44
88
 
45
89
  .dialog-header-primary,
@@ -49,10 +93,16 @@
49
93
 
50
94
  .dialog-header-primary {
51
95
  @include list-item-primary();
52
- @include force-text-wrap();
53
- font-size: $font-size-large;
96
+ font-size: $font-size-normal + 2px;
54
97
  font-weight: bold;
55
- padding: 0;
98
+ padding-left: $spacing-normal;
99
+ padding-right: $spacing-normal;
100
+ }
101
+
102
+ @media (min-width: $small-width) {
103
+ .dialog-header-primary {
104
+ font-size: $font-size-large;
105
+ }
56
106
  }
57
107
 
58
108
  .dialog-header-primary-subtext {
@@ -67,12 +117,12 @@
67
117
  @include list-item-secondary-actions();
68
118
  }
69
119
 
70
-
71
120
  // Dialogs - content
72
121
  //----------------------------------------------------------------------
73
122
 
74
123
  .dialog-content {
75
- padding: 0 $spacing-large $spacing-normal $spacing-large;
124
+ padding: $spacing-normal;
125
+ padding-top: 0;
76
126
  @include force-text-wrap()
77
127
  }
78
128
 
@@ -81,4 +131,96 @@
81
131
 
82
132
  .dialog-actions {
83
133
  padding: $spacing-normal;
134
+ padding-top: 0;
84
135
  }
136
+
137
+ .dialog-actions-bordered {
138
+ border-top: 1px solid color("divider");
139
+ padding-top: $spacing-normal;
140
+ }
141
+
142
+
143
+ // // Dialogs - base
144
+ // //----------------------------------------------------------------------
145
+ //
146
+ // .dialog {
147
+ // background: color("white");
148
+ // cursor: default;
149
+ // display: inline-block;
150
+ // margin: auto;
151
+ // max-width: 90%;
152
+ // pointer-events: none;
153
+ // position: relative;
154
+ // visibility: hidden;
155
+ // width: 500px; // max-width above caps this
156
+ // will-change: scale, transparency;
157
+ // z-index: $dialog-depth;
158
+ // @include box-shadow(0 12px 15px 0 rgba(0,0,0,0.24));
159
+ // @include rounded-corners;
160
+ // @include transition(all 0.10s ease);
161
+ // @include transform(scale(1.15));
162
+ // @include transparency(0);
163
+ //
164
+ // &.visible {
165
+ // pointer-events: auto;
166
+ // visibility: visible;
167
+ // @include transform(scale(1.0));
168
+ // @include transparency(1);
169
+ // @include transition(all 0.30s ease);
170
+ // }
171
+ // }
172
+ //
173
+ // // Dialogs - header
174
+ // //----------------------------------------------------------------------
175
+ //
176
+ // .dialog-header {
177
+ // @include list-item();
178
+ // min-height: 0;
179
+ // padding: $spacing-large;
180
+ // padding-bottom: 20px;
181
+ // }
182
+ //
183
+ // .dialog-header-icon {
184
+ // @include list-item-icon();
185
+ // }
186
+ //
187
+ // .dialog-header-primary,
188
+ // .dialog-header-secondary {
189
+ // box-sizing: border-box;
190
+ // }
191
+ //
192
+ // .dialog-header-primary {
193
+ // @include list-item-primary();
194
+ // @include force-text-wrap();
195
+ // font-size: $font-size-large;
196
+ // font-weight: bold;
197
+ // padding: 0;
198
+ // }
199
+ //
200
+ // .dialog-header-primary-subtext {
201
+ // @include list-item-primary-subtext();
202
+ // }
203
+ //
204
+ // .dialog-header-secondary {
205
+ // @include list-item-secondary();
206
+ // }
207
+ //
208
+ // .dialog-header-secondary-actions {
209
+ // @include list-item-secondary-actions();
210
+ // }
211
+ //
212
+ //
213
+ // // Dialogs - content
214
+ // //----------------------------------------------------------------------
215
+ //
216
+ // .dialog-content {
217
+ // padding: 0 $spacing-large $spacing-normal $spacing-large;
218
+ // @include force-text-wrap()
219
+ // }
220
+ //
221
+ // // Dialogs - actions
222
+ // //----------------------------------------------------------------------
223
+ //
224
+ // .dialog-actions {
225
+ // padding: $spacing-normal;
226
+ // }
@@ -44,7 +44,7 @@
44
44
  @import "components/forms/segmented_controls";
45
45
  @import "components/forms/helper_texts";
46
46
  @import "components/cards";
47
- // @import "components/dialogs";
47
+ @import "components/dialogs";
48
48
  @import "components/overlay";
49
49
  @import "components/panels";
50
50
  @import "components/progress_bar";
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dlegr250_material_design
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.81
4
+ version: 0.4.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel LeGrand