Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -119,6 +119,7 @@ |
120 | 120 | * (bug 33456) Show $wgQueryCacheLimit on cached query pages. |
121 | 121 | * (bug 10574) Add an option to allow all pages to be exported by Special:Export. |
122 | 122 | * Use mw.jqueryMsg parser for message parsing to support PLURAL and GENDER |
| 123 | +* (bug 29309) allow CSS class per tooltip (tipsy) |
123 | 124 | |
124 | 125 | === Bug fixes in 1.19 === |
125 | 126 | * $wgUploadNavigationUrl should be used for file redlinks if. |
Index: trunk/phase3/resources/jquery.tipsy/jquery.tipsy.js |
— | — | @@ -4,7 +4,11 @@ |
5 | 5 | // releated under the MIT license |
6 | 6 | |
7 | 7 | (function($) { |
8 | | - |
| 8 | + |
| 9 | + function maybeCall(thing, ctx) { |
| 10 | + return (typeof thing == 'function') ? (thing.call(ctx)) : thing; |
| 11 | + }; |
| 12 | + |
9 | 13 | function fixTitle($ele) { |
10 | 14 | if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') { |
11 | 15 | $ele.attr('original-title', $ele.attr('title') || '').removeAttr('title'); |
— | — | @@ -71,6 +75,9 @@ |
72 | 76 | } |
73 | 77 | |
74 | 78 | $tip.css(tp).addClass('tipsy-' + gravity); |
| 79 | + if (this.options.className) { |
| 80 | + $tip.addClass(maybeCall(this.options.className, this.$element[0])); |
| 81 | + } |
75 | 82 | |
76 | 83 | if (this.options.fade) { |
77 | 84 | $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}, 100); |
— | — | @@ -174,6 +181,7 @@ |
175 | 182 | }; |
176 | 183 | |
177 | 184 | $.fn.tipsy.defaults = { |
| 185 | + className: null, |
178 | 186 | delayIn: 0, |
179 | 187 | delayOut: 0, |
180 | 188 | fade: true, |