jquery-qtip2-rails 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -152,7 +152,7 @@ function Modal(api)
152
152
 
153
153
  create: function()
154
154
  {
155
- var elem = $(overlaySelector);
155
+ var elem = $(overlaySelector), win = $(window);
156
156
 
157
157
  // Return if overlay is already rendered
158
158
  if(elem.length) {
@@ -172,11 +172,11 @@ function Modal(api)
172
172
  // Update position on window resize or scroll
173
173
  function resize() {
174
174
  overlay.css({
175
- height: $(window).height(),
176
- width: $(window).width()
175
+ height: win.height(),
176
+ width: win.width()
177
177
  });
178
178
  }
179
- $(window).unbind(globalNamespace).bind('resize'+globalNamespace, resize);
179
+ win.unbind(globalNamespace).bind('resize'+globalNamespace, resize);
180
180
  resize(); // Fire it initially too
181
181
 
182
182
  return overlay;
@@ -197,7 +197,9 @@ function Modal(api)
197
197
  if(!overlay) { overlay = self.create(); }
198
198
 
199
199
  // Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible
200
- if((overlay.is(':animated') && visible === state) || (!state && modals.length)) { return self; }
200
+ if((overlay.is(':animated') && visible === state && overlay.data('toggleState') !== FALSE) || (!state && modals.length)) {
201
+ return self;
202
+ }
201
203
 
202
204
  // State specific...
203
205
  if(state) {
@@ -222,7 +224,7 @@ function Modal(api)
222
224
  }
223
225
 
224
226
  // Stop all animations
225
- overlay.stop(TRUE, FALSE);
227
+ overlay.stop(TRUE, FALSE).data('toggleState', state);
226
228
 
227
229
  // Use custom function if provided
228
230
  if($.isFunction(effect)) {
@@ -244,7 +246,7 @@ function Modal(api)
244
246
  // Reset position on hide
245
247
  if(!state) {
246
248
  overlay.queue(function(next) {
247
- overlay.css({ left: '', top: '' });
249
+ overlay.css({ left: '', top: '' }).removeData('toggleState');
248
250
  next();
249
251
  });
250
252
  }
@@ -273,7 +275,7 @@ function Modal(api)
273
275
  }
274
276
 
275
277
  // Undelegate focus handler
276
- docBody.undelegate('*', 'focusin'+namespace);
278
+ docBody.unbind('focusin'+namespace);
277
279
  }
278
280
 
279
281
  // Remove bound events
@@ -1,25 +1,22 @@
1
1
  /* Tips plugin */
2
- .ui-tooltip .ui-tooltip-tip{
2
+ .qtip .qtip-tip{
3
3
  margin: 0 auto;
4
4
  overflow: hidden;
5
5
  z-index: 10;
6
6
  }
7
7
 
8
- .ui-tooltip .ui-tooltip-tip,
9
- .ui-tooltip .ui-tooltip-tip .qtip-vml{
8
+ .qtip .qtip-tip,
9
+ .qtip .qtip-tip .qtip-vml{
10
10
  position: absolute;
11
-
12
- line-height: 0.1px !important;
13
- font-size: 0.1px !important;
14
- color: #123456;
15
11
 
12
+ color: #123456;
16
13
  background: transparent;
17
14
  border: 0 dashed transparent;
18
15
  }
19
16
 
20
- .ui-tooltip .ui-tooltip-tip canvas{ top: 0; left: 0; }
17
+ .qtip .qtip-tip canvas{ top: 0; left: 0; }
21
18
 
22
- .ui-tooltip .ui-tooltip-tip .qtip-vml{
19
+ .qtip .qtip-tip .qtip-vml{
23
20
  behavior: url(#default#VML);
24
21
  display: inline-block;
25
22
  visibility: visible;
@@ -139,7 +139,7 @@ function Tip(qTip, command)
139
139
  // Viewport "shift" specific adjustments
140
140
  if(shift.left = (horizontal === SHIFT && !!adjust.left)) {
141
141
  if(newCorner.x === CENTER) {
142
- css['margin-left'] = shift.x = offset['margin-left'] - adjust.left;
142
+ css['margin-left'] = shift.x = offset['margin-left'];
143
143
  }
144
144
  else {
145
145
  props = offset.right !== undefined ?
@@ -155,7 +155,7 @@ function Tip(qTip, command)
155
155
  }
156
156
  if(shift.top = (vertical === SHIFT && !!adjust.top)) {
157
157
  if(newCorner.y === CENTER) {
158
- css['margin-top'] = shift.y = offset['margin-top'] - adjust.top;
158
+ css['margin-top'] = shift.y = offset['margin-top'];
159
159
  }
160
160
  else {
161
161
  props = offset.bottom !== undefined ?
@@ -325,17 +325,6 @@ function Tip(qTip, command)
325
325
 
326
326
  // Bind update events
327
327
  tooltip.unbind(namespace).bind('tooltipmove'+namespace, reposition);
328
-
329
- // Fix for issue of tips not showing after redraw in IE (VML...)
330
- if(!hasCanvas) {
331
- tooltip.bind('tooltipredraw tooltipredrawn', function(event) {
332
- if(event.type === 'tooltipredraw') {
333
- tiphtml = elems.tip.html();
334
- elems.tip.html('');
335
- }
336
- else { elems.tip.html(tiphtml); }
337
- });
338
- }
339
328
  }
340
329
 
341
330
  return enabled;
@@ -351,7 +340,7 @@ function Tip(qTip, command)
351
340
  if(elems.tip) { elems.tip.remove(); }
352
341
 
353
342
  // Create tip element and prepend to the tooltip
354
- elems.tip = $('<div />', { 'class': 'ui-tooltip-tip' }).css({ width: width, height: height }).prependTo(tooltip);
343
+ elems.tip = $('<div />', { 'class': 'qtip-tip' }).css({ width: width, height: height }).prependTo(tooltip);
355
344
 
356
345
  // Create tip drawing element(s)
357
346
  if(hasCanvas) {
@@ -429,7 +418,7 @@ function Tip(qTip, command)
429
418
 
430
419
  // Determine tip size
431
420
  self.size = newSize = calculateSize(corner);
432
- tip.css(newSize);
421
+ tip.css(newSize).css('line-height', newSize.height+'px');
433
422
 
434
423
  // Calculate tip translation
435
424
  if(corner.precedance === Y) {
@@ -104,7 +104,7 @@ PLUGINS.viewport = function(api, position, posOptions, targetWidth, targetHeight
104
104
  };
105
105
 
106
106
  // Set tooltip position class if it's changed
107
- if(newMy && cache.lastClass !== (newClass = uitooltip + '-pos-' + newMy.abbrev())) {
107
+ if(newMy && cache.lastClass !== (newClass = NAMESPACE + '-pos-' + newMy.abbrev())) {
108
108
  tooltip.removeClass(api.cache.lastClass).addClass( (api.cache.lastClass = newClass) );
109
109
  }
110
110
 
@@ -4,4 +4,5 @@
4
4
  *= include jquery-qtip/src/css3.css
5
5
  *= include jquery-qtip/src/tips/tips.css
6
6
  *= include jquery-qtip/src/modal/modal.css
7
+ *= include jquery-qtip/src/ie6/ie6.css
7
8
  */
@@ -6,5 +6,5 @@
6
6
  //= include jquery-qtip/src/modal/modal.js
7
7
  //= include jquery-qtip/src/viewport/viewport.js
8
8
  //= include jquery-qtip/src/imagemap/imagemap.js
9
- //= include jquery-qtip/src/bgiframe/bgiframe.js
9
+ //= include jquery-qtip/src/ie6/ie6.js
10
10
  //= include jquery-qtip/src/outro.js
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-qtip2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-27 00:00:00.000000000 Z
12
+ date: 2013-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70169318666520 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70169318666520
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.1.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rails
27
- requirement: &70169318666100 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70169318666100
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: jquery-rails
38
- requirement: &70169318665640 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,7 +53,12 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70169318665640
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  description: qTip2 jQuery plugin
48
63
  email:
49
64
  - tkrotoff@gmail.com
@@ -97,10 +112,11 @@ files:
97
112
  - test/dummy/script/rails
98
113
  - vendor/assets/jquery-qtip/jquery-qtip/src/ajax/ajax.js
99
114
  - vendor/assets/jquery-qtip/jquery-qtip/src/basic.css
100
- - vendor/assets/jquery-qtip/jquery-qtip/src/bgiframe/bgiframe.js
101
115
  - vendor/assets/jquery-qtip/jquery-qtip/src/core.css
102
116
  - vendor/assets/jquery-qtip/jquery-qtip/src/core.js
103
117
  - vendor/assets/jquery-qtip/jquery-qtip/src/css3.css
118
+ - vendor/assets/jquery-qtip/jquery-qtip/src/ie6/ie6.css
119
+ - vendor/assets/jquery-qtip/jquery-qtip/src/ie6/ie6.js
104
120
  - vendor/assets/jquery-qtip/jquery-qtip/src/imagemap/imagemap.js
105
121
  - vendor/assets/jquery-qtip/jquery-qtip/src/intro.js
106
122
  - vendor/assets/jquery-qtip/jquery-qtip/src/modal/modal.css
@@ -134,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
150
  version: '0'
135
151
  requirements: []
136
152
  rubyforge_project:
137
- rubygems_version: 1.8.15
153
+ rubygems_version: 1.8.23
138
154
  signing_key:
139
155
  specification_version: 3
140
156
  summary: qTip2 packaged for the Rails 3.1+ asset pipeline
@@ -1,76 +0,0 @@
1
- /*
2
- * BGIFrame adaption (http://plugins.jquery.com/project/bgiframe)
3
- * Special thanks to Brandon Aaron
4
- */
5
- function BGIFrame(api)
6
- {
7
- var self = this,
8
- elems = api.elements,
9
- tooltip = elems.tooltip,
10
- namespace = '.bgiframe-' + api.id;
11
-
12
- $.extend(self, {
13
- init: function()
14
- {
15
- // Create the BGIFrame element
16
- elems.bgiframe = $('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" ' +
17
- ' style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); ' +
18
- '-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>');
19
-
20
- // Append the new element to the tooltip
21
- elems.bgiframe.appendTo(tooltip);
22
-
23
- // Update BGIFrame on tooltip move
24
- tooltip.bind('tooltipmove'+namespace, self.adjust);
25
- },
26
-
27
- adjust: function()
28
- {
29
- var dimensions = api.get('dimensions'), // Determine current tooltip dimensions
30
- plugin = api.plugins.tip,
31
- tip = elems.tip,
32
- tipAdjust, offset;
33
-
34
- // Adjust border offset
35
- offset = parseInt(tooltip.css('border-left-width'), 10) || 0;
36
- offset = { left: -offset, top: -offset };
37
-
38
- // Adjust for tips plugin
39
- if(plugin && tip) {
40
- tipAdjust = (plugin.corner.precedance === 'x') ? ['width', 'left'] : ['height', 'top'];
41
- offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ]();
42
- }
43
-
44
- // Update bgiframe
45
- elems.bgiframe.css(offset).css(dimensions);
46
- },
47
-
48
- destroy: function()
49
- {
50
- // Remove iframe
51
- elems.bgiframe.remove();
52
-
53
- // Remove bound events
54
- tooltip.unbind(namespace);
55
- }
56
- });
57
-
58
- self.init();
59
- }
60
-
61
- PLUGINS.bgiframe = function(api)
62
- {
63
- var browser = $.browser,
64
- self = api.plugins.bgiframe;
65
-
66
- // Proceed only if the browser is IE6 and offending elements are present
67
- if($('select, object').length < 1 || !(browser.msie && (''+browser.version).charAt(0) === '6')) {
68
- return FALSE;
69
- }
70
-
71
- return 'object' === typeof self ? self : (api.plugins.bgiframe = new BGIFrame(api));
72
- };
73
-
74
- // Plugin needs to be initialized on render
75
- PLUGINS.bgiframe.initialize = 'render';
76
-