corn_js 0.1.9 → 0.1.10

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.
@@ -1,3 +1,4 @@
1
1
  //= require corn_js/popcorn
2
2
  //= require corn_js/activemetadata
3
- //= require corn_js/fileuploader
3
+ //= require corn_js/fileuploader
4
+
@@ -3,13 +3,17 @@ var exports = window.exports || {};
3
3
  (function (exports) {
4
4
 
5
5
  var Popcorn = exports.Popcorn = function ($element, defaults) {
6
+
6
7
  this.$element = $element;
7
8
  this.$anchor = this.$element;
8
9
  this.defaults = defaults;
10
+
9
11
  };
10
12
 
11
13
  Popcorn.prototype.decorateContainerWithHtml = function () {
12
- if (this.positionType) { throw "inferPositionType must be called after decorateContainerWithHtml"; }
14
+ if (this.positionType) {
15
+ throw "inferPositionType must be called after decorateContainerWithHtml";
16
+ }
13
17
 
14
18
  this.containerOf().hide().addClass('popcorn');
15
19
 
@@ -24,10 +28,16 @@ var exports = window.exports || {};
24
28
  this.$anchor = this.$element;
25
29
 
26
30
  function _createPositionType() {
27
- if (self.$element.offset().left < 1) { self.$anchor = self.$element.parent(); }
28
-
29
- if (self.collideLeft()) { return new LeftPosition(self); }
30
- else if (self.collideRight()) { return new RightPosition(self); }
31
+ if (self.$element.offset().left < 1) {
32
+ self.$anchor = self.$element.parent();
33
+ }
34
+
35
+ if (self.collideLeft()) {
36
+ return new LeftPosition(self);
37
+ }
38
+ else if (self.collideRight()) {
39
+ return new RightPosition(self);
40
+ }
31
41
  return new CenterPosition(self);
32
42
  }
33
43
 
@@ -43,10 +53,16 @@ var exports = window.exports || {};
43
53
 
44
54
  var LeftPosition = function (popcorn) {
45
55
  // TODO centrare la freccia sull'elemento puntato da fatpopcorn
46
- // this.leftOffset = function() {return popcorn.$element.offset().left + (popcorn.$element.width() - popcorn.defaults.arrowWidth) / 2; }
47
- this.leftOffset = function () { return popcorn.defaults.marginArrow; };
48
- this.left = function () { return popcorn.defaults.marginBorder; };
49
- this.top = function () { return popcorn.$anchor.offset().top + popcorn.defaults.verticalOffsetFromElement; };
56
+ this.leftOffset = function () {
57
+ return popcorn.$element.offset().left + (popcorn.$element.width() - popcorn.defaults.arrowWidth) / 2;
58
+ };
59
+ // this.leftOffset = function () { return popcorn.defaults.marginArrow; };
60
+ this.left = function () {
61
+ return popcorn.defaults.marginBorder;
62
+ };
63
+ this.top = function () {
64
+ return popcorn.$anchor.offset().top + popcorn.defaults.verticalOffsetFromElement;
65
+ };
50
66
  };
51
67
 
52
68
  var RightPosition = function (popcorn) {
@@ -167,6 +183,7 @@ var exports = window.exports || {};
167
183
  popcorn.setContainerPosition();
168
184
  });
169
185
  }
186
+
170
187
  return this.each(_setUpElement);
171
188
  };
172
189
  })(jQuery, exports);
@@ -13,7 +13,6 @@ a:hover {
13
13
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.5);
14
14
  color: #444444;
15
15
  font-size: 11px;
16
- width: 160px;
17
16
  min-height:20px;
18
17
  overflow: visible;
19
18
  position: absolute;
@@ -21,7 +20,7 @@ a:hover {
21
20
  margin-top: 4px;
22
21
  }
23
22
  .popcorn .popcorn-body {
24
- padding: 5px;
23
+ padding: 0;
25
24
  }
26
25
  .popcorn .popcorn-tail {
27
26
  background: url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAKCAYAAABWiWWfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJlJREFUeNpi/P//PwM+wMjIqAKkQPgOUO0dfGqZCBikm5iYGPTmzZsZQUFBPkC+Nl6bQS7DhoEAZFDZjx8/PgL5/79+/foWaGABUFwbpx5iDIIBkIG+vr55uAzEalBMTEwJukHEGEiSQYQMJNkgLAZqoRgGBDqkGAQDX758eY1sINygb9++vf9PBkA2kAFoEBO5BqEZyAQQYAAiweCss5BeRQAAAABJRU5ErkJggg==") no-repeat scroll 0 100% transparent;
@@ -276,7 +276,7 @@
276
276
  left: 10px;
277
277
  font-size: 22px;
278
278
  color: #ccc;
279
- background-color: #ffffff !important;
279
+ background-color: inherit !important;
280
280
  text-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0;
281
281
  }
282
282
  .stickycorn .loader {
@@ -1,3 +1,3 @@
1
1
  module CornJs
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corn_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-06 00:00:00.000000000 Z
12
+ date: 2012-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -97,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
97
  version: '0'
98
98
  segments:
99
99
  - 0
100
- hash: -456204210793432441
100
+ hash: 623294568950664266
101
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  none: false
103
103
  requirements:
@@ -106,10 +106,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: -456204210793432441
109
+ hash: 623294568950664266
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 1.8.21
112
+ rubygems_version: 1.8.24
113
113
  signing_key:
114
114
  specification_version: 3
115
115
  summary: A javascript popup menu plugin