active_frontend 2.0.11 → 2.0.12

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: 29b35a8a9004aa928de48a975c29fa7e3e059aa6
4
- data.tar.gz: ad9af5736fe77d2d1c5ad310a8540821659f5fc9
3
+ metadata.gz: b7e91d4292e31fd7dee56656a7c4b0d0ebe7ed11
4
+ data.tar.gz: 6d6e8124b97bf558efc6902208541098ee767df7
5
5
  SHA512:
6
- metadata.gz: 12892902f34a5fca4b1890d026605363521822a54b38f2521872f8f6f4028d429935945535d45a9362511cb2eee825236dd36076d005648d77e2375e5fdb8c87
7
- data.tar.gz: 2b879180927c23a518f48f02412ff76ef246f0ae92b0004c039fabfaf0526cb22ff6861bdabb9d772021424b19914be2fa73f2d93a4d198e34cd6a11a503c62a
6
+ metadata.gz: 17321d1381613b49bb12cd4ce5ab9a1743463fd47ad62a54d145984afd69e36a3ecf092cd2a45b80133ca2b9316129213f27eae19f47156983c336276d010736
7
+ data.tar.gz: 2b1b7d3c37c0e65566f769c22c3b63288c7d299e2430361521fd39af15a50753b977acbbaa8db783817cbc75cccf211f388e3f3f6fc8c612c2ba7f5e9620cb2c
@@ -1,3 +1,3 @@
1
1
  module ActiveFrontend
2
- VERSION = "2.0.11"
2
+ VERSION = "2.0.12"
3
3
  end
@@ -12,73 +12,55 @@
12
12
  constructor : ColorPicker,
13
13
 
14
14
  _init : function() {
15
-
16
- var callback = this.options.callback;
17
-
15
+ var callback = this.options.callback;
18
16
  var selectValue = this.$select.val();
19
17
  var selectColor = this.$select.find("option:selected").data("color");
20
18
 
21
- var $markupUl = $("<ul>").addClass("dropdown-menu").addClass("dropdown-caret");
22
- var $markupDiv = $("<div>").addClass("dropdown").addClass("dropdown-colorpicker");
23
- var $markupSpan = $("<span>").addClass("btn-colorpicker").css("background-color", selectColor);
24
- var $markupA = $("<a>").attr("data-toggle", "dropdown").addClass("dropdown-toggle").attr("href", "#").append($markupSpan);
19
+ var $markupUl = $("<ul>").addClass("dropdown-menu").addClass("dropdown-caret");
20
+ var $markupDiv = $("<div>").addClass("dropdown").addClass("dropdown-colorpicker");
21
+ var $markupSpan = $("<span>").addClass("dropdown-swatch").css("background", selectColor);
22
+ var $markupA = $("<a>").attr("data-toggle", "dropdown").addClass("dropdown-toggle").attr("href", "#").append($markupSpan);
25
23
 
26
- // create an li-tag for every option of the select
27
24
  $("option", this.$select).each(function() {
28
-
29
25
  var option = $(this);
30
- var value = option.attr("value");
31
- var color = option.data("color");
32
- var title = option.text();
26
+ var value = option.attr("value");
27
+ var color = option.data("color");
28
+ var title = option.text();
33
29
 
34
- // create a-tag
35
- var $markupA = $("<a>").addClass("color-btn");
30
+ var $markupA = $("<a>").addClass("colorpicker-swatch");
36
31
  if (option.prop("selected") === true || selectValue === color) {
37
32
  $markupA.addClass("selected");
38
33
  }
39
- $markupA.css("background-color", color);
34
+ $markupA.css("background", color);
40
35
  $markupA.attr("href", "#").attr("data-color", color).attr("data-value", value).attr("title", title);
41
36
 
42
- // create li-tag
43
37
  $markupUl.append($("<li>").append($markupA));
44
38
  });
45
39
 
46
- // append the colorpicker
47
40
  $markupDiv.append($markupA);
48
- // append the colorpicker-dropdown
49
41
  $markupDiv.append($markupUl);
50
42
 
51
- // hide the select
52
43
  this.$select.hide();
53
-
54
- // insert the colorpicker
55
44
  this.$selector = $($markupDiv).insertAfter(this.$select);
56
-
57
- // register change handler
58
45
  this.$select.on("change", function() {
59
-
60
46
  var value = $(this).val();
61
47
  var color = $(this).find("option[value='" + value + "']").data("color");
62
48
  var title = $(this).find("option[value='" + value + "']").text();
63
49
 
64
- // remove old and set new selected color
65
50
  $(this).next().find("ul").find("li").find(".selected").removeClass("selected");
66
51
  $(this).next().find("ul").find("li").find("a[data-color='" + color + "']").addClass("selected");
67
-
68
- $(this).next().find(".btn-colorpicker").css("background-color", color);
52
+ $(this).next().find(".dropdown-swatch").css("background", color);
69
53
 
70
54
  callback(value, color, title);
71
55
  });
72
56
 
73
- // register click handler
74
57
  $markupUl.on('click.colorpicker', $.proxy(this._clickColor, this));
75
58
  },
76
59
 
77
60
  _clickColor : function(e) {
78
-
79
61
  var a = $(e.target);
80
62
 
81
- if (!a.is(".color-btn")) {
63
+ if (!a.is(".colorpicker-swatch")) {
82
64
  return false;
83
65
  }
84
66
 
@@ -89,7 +71,6 @@
89
71
  },
90
72
 
91
73
  setColor : function(color) {
92
- // find value for color
93
74
  var value = $(this.$selector).find("li").find("a[data-color='" + color + "']").data("value");
94
75
  this.setValue(value);
95
76
  },
@@ -105,12 +86,12 @@
105
86
  args.shift();
106
87
 
107
88
  return this.each(function() {
108
-
109
89
  var $this = $(this), data = $this.data("colorpicker"), options = $.extend({}, $.fn.colorpicker.defaults, $this.data(), typeof option == "object" && option);
110
90
 
111
91
  if (!data) {
112
92
  $this.data("colorpicker", (data = new ColorPicker(this, options)));
113
93
  }
94
+
114
95
  if (typeof option == "string") {
115
96
  data[option].apply(data, args);
116
97
  }
@@ -4,41 +4,17 @@
4
4
 
5
5
  /* # Colorpicker
6
6
  ================================================== */
7
- .dropdown-colorpicker > .dropdown-menu {
8
- left: -7px;
9
- padding: 4px;
10
- }
11
- .dropdown-colorpicker > .dropdown-menu.pull-right {
12
- left: auto;
13
- right: -7px;
14
- }
15
- .dropdown-colorpicker > .dropdown-menu.dropdown-caret:before {
16
- border-bottom: 7px solid rgba(245,248,250,1);
17
- border-left: 7px solid transparent;
18
- border-right: 7px solid transparent;
19
- content: "";
20
- display: inline-block;
21
- left: 9px;
22
- position: absolute;
23
- top: -7px;
24
- }
25
- .dropdown-colorpicker > .dropdown-menu.dropdown-caret:after {
26
- border-bottom: 6px solid rgba(245,248,250,1);
27
- border-left: 6px solid transparent;
28
- border-right: 6px solid transparent;
29
- content: "";
7
+ .dropdown-swatch {
8
+ background: rgba(102,117,127,1);
9
+ border-radius: 2px;
30
10
  display: inline-block;
31
- left: 10px;
32
- position: absolute;
33
- top: -6px;
34
- }
35
- .dropdown-colorpicker > .dropdown-menu.pull-right.dropdown-caret:before {
36
- left: auto;
37
- right: 9px;
11
+ height: 25px;
12
+ vertical-align: middle;
13
+ width: 25px;
38
14
  }
39
- .dropdown-colorpicker > .dropdown-menu.pull-right.dropdown-caret:after {
40
- left: auto;
41
- right: 10px;
15
+ .dropdown-colorpicker > .dropdown-menu {
16
+ margin-left: -5px;
17
+ padding: 4px;
42
18
  }
43
19
  .dropdown-colorpicker > .dropdown-menu > li {
44
20
  display: block;
@@ -47,7 +23,7 @@
47
23
  height: 26px;
48
24
  margin: 2px;
49
25
  }
50
- .dropdown-colorpicker > .dropdown-menu > li > .color-btn {
26
+ .dropdown-colorpicker > .dropdown-menu > li > .colorpicker-swatch {
51
27
  border-radius: 2px;
52
28
  display: block;
53
29
  height: 26px;
@@ -59,7 +35,7 @@
59
35
  transition: all ease 0.1s;
60
36
  width: 26px;
61
37
  }
62
- .dropdown-colorpicker > .dropdown-menu > li > .color-btn.selected:after {
38
+ .dropdown-colorpicker > .dropdown-menu > li > .colorpicker-swatch.selected:after {
63
39
  color: rgba(255,255,255,1);
64
40
  content: "\f3fe";
65
41
  display: inline-block;
@@ -70,12 +46,4 @@
70
46
  position: absolute;
71
47
  right: 0;
72
48
  text-align: center;
73
- }
74
- .btn-colorpicker {
75
- background: rgba(102,117,127,1);
76
- border-radius: 2px;
77
- display: inline-block;
78
- height: 25px;
79
- vertical-align: middle;
80
- width: 25px;
81
49
  }
@@ -74,6 +74,7 @@
74
74
  cursor: pointer;
75
75
  }
76
76
  .datepicker td.day.disabled { color: rgba(136,153,166,1); }
77
+ .datepicker td.day.disabled:hover { color: rgba(43,50,53,1); }
77
78
  .datepicker td.old,
78
79
  .datepicker td.new { color: rgba(136,153,166,1); }
79
80
  .datepicker td.active,
@@ -67,6 +67,35 @@
67
67
  padding-right: 20px;
68
68
  padding-left: 20px;
69
69
  }
70
+ .dropdown-menu.dropdown-caret { top: calc(100% + 5px); }
71
+ .dropdown-menu.dropdown-caret:before {
72
+ border-bottom: 7px solid rgba(240,243,250,1);
73
+ border-left: 7px solid transparent;
74
+ border-right: 7px solid transparent;
75
+ content: "";
76
+ display: inline-block;
77
+ left: 9px;
78
+ position: absolute;
79
+ top: -7px;
80
+ }
81
+ .dropdown-menu.dropdown-caret:after {
82
+ border-bottom: 6px solid rgba(245,248,250,1);
83
+ border-left: 6px solid transparent;
84
+ border-right: 6px solid transparent;
85
+ content: "";
86
+ display: inline-block;
87
+ left: 10px;
88
+ position: absolute;
89
+ top: -6px;
90
+ }
91
+ .dropdown-menu.pull-right.dropdown-caret:before {
92
+ left: auto;
93
+ right: 9px;
94
+ }
95
+ .dropdown-menu.pull-right.dropdown-caret:after {
96
+ left: auto;
97
+ right: 10px;
98
+ }
70
99
 
71
100
  /* # Submenu
72
101
  ================================================== */
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.11
4
+ version: 2.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.4.6
172
+ rubygems_version: 2.4.7
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: ActiveFrontend Responsive Web Framework