dlegr250_material_design 0.2.08 → 0.2.09

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: 56e0858294552941033f5258e17fb099a6edbab8
4
- data.tar.gz: ab7d77908d583b1f3812186692cfb86ad6639056
3
+ metadata.gz: 13201ed1ecd6440dbd2b2c8e3fda9d1567e5fd94
4
+ data.tar.gz: 50b61129e13890dc3ab7c3c9216e78f5acd17f9b
5
5
  SHA512:
6
- metadata.gz: 705d19a72ff60363f563e5ec7581ce88e5a64b294509b5292607274c2790ecf1c71b52988ba076432f9057172a40bbc9e1abfc849e54efddc6785e9d8154d723
7
- data.tar.gz: 3b127d7981436b4ce82f90cceb5179254e381ec680cbb27588394f9695d2309cbc13470febc9bc92079e557f707f25573774763a43676d39db46f69077e3d7e0
6
+ metadata.gz: 9e0ff6a0f70d80b437b878b89afb9d369795a9a422b811740e13ee8636587229aef3cd6df8007fcaec8c4a5b381299d34ee94e26cb40401c55aea7d150c94b0f
7
+ data.tar.gz: 63e5028efdf444fa871a9206e440c6eddb23bcf6f7c7e2f0baae58ed9dc94f24129b6da212ddd67e412f2c6959b8009f2672f22362a45f7ff923f438efd1782c
@@ -1,3 +1,3 @@
1
1
  module Dlegr250MaterialDesign
2
- VERSION = "0.2.08"
2
+ VERSION = "0.2.09"
3
3
  end
@@ -11,12 +11,19 @@ class App.MD.Snackbar
11
11
  $("body").on "click", "#snackbar", =>
12
12
  @hide()
13
13
 
14
+ if $("body").data("snackbar").length > 0
15
+ App.MD.Snackbar.create($("body").data("snackbar"))
16
+
17
+ if $("body").data("snackbar-error").length > 0
18
+ App.MD.Snackbar.create($("body").data("snackbar-error"), { css_class: "snackbar-error" })
19
+
14
20
  @create: (text, options = {}) ->
15
21
  @text = text
16
22
 
17
23
  # Set options to override defaults
18
24
  @duration = options["duration"] || 5000
19
25
  @delay = options["delay"] || 500
26
+ @css_class = options["css_class"] || ""
20
27
 
21
28
  if @visible
22
29
  # Force hide current one via animation
@@ -37,7 +44,7 @@ class App.MD.Snackbar
37
44
 
38
45
  @show: () ->
39
46
  @element().html(@text)
40
- @element().addClass("visible")
47
+ @element().addClass(@css_class).addClass("visible")
41
48
  $(".fab").addClass("move-with-snackbar")
42
49
 
43
50
  @hide: () ->
@@ -21,6 +21,10 @@
21
21
  @include transform(translateY(200%));
22
22
  @include transition(transform 0.15s cubic-bezier(0, 0, 0.3, 1));
23
23
 
24
+ .snackbar-error {
25
+ color: color("red") !important;
26
+ }
27
+
24
28
  &.visible {
25
29
  pointer-events: auto;
26
30
  @include transform(none);
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.2.08
4
+ version: 0.2.09
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel LeGrand