|
1 | 1 | /* |
2 | | - * webui popover plugin - v1.0.5 |
| 2 | + * webui popover plugin - v1.0.9 |
3 | 3 | * A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary! |
4 | 4 | * https://github.com/sandywalker/webui-popover |
5 | 5 | * |
|
211 | 211 | return this.getTarget().find('.'+pluginClass+'-content'); |
212 | 212 | }, |
213 | 213 | getTitle:function(){ |
214 | | - return this.options.title||this.$element.attr('data-title')||this.$element.attr('title'); |
| 214 | + return this.$element.attr('data-title')||this.options.title||this.$element.attr('title'); |
215 | 215 | }, |
216 | 216 | getUrl:function(){ |
217 | | - return this.options.url||this.$element.attr('data-url'); |
| 217 | + return this.$element.attr('data-url')||this.options.url; |
218 | 218 | }, |
219 | 219 | getDelayShow:function(){ |
220 | | - return this.options.delay.show||this.$element.attr('data-delay-show')||0; |
| 220 | + var dataAttr = this.$element.attr('data-delay-show'); |
| 221 | + if (typeof(dataAttr) !== 'undefined') { |
| 222 | + return dataAttr; |
| 223 | + } |
| 224 | + return this.options.delay.show||0; |
221 | 225 | }, |
222 | 226 | getHideDelay:function(){ |
223 | | - return this.options.delay.hide||this.$element.attr('data-delay-hide')||300; |
| 227 | + var dataAttr = this.$element.attr('data-delay-hide'); |
| 228 | + if (typeof(dataAttr) !== 'undefined') { |
| 229 | + return dataAttr; |
| 230 | + } |
| 231 | + return this.options.delay.hide||300; |
224 | 232 | }, |
225 | 233 | getConstrains:function(){ |
226 | | - return this.options.constrains||this.$element.attr('data-contrains'); |
| 234 | + var dataAttr = this.$element.attr('data-contrains'); |
| 235 | + if (typeof(dataAttr) !== 'undefined') { |
| 236 | + return dataAttr; |
| 237 | + } |
| 238 | + return this.options.constrains; |
227 | 239 | }, |
228 | 240 | setTitle:function(title){ |
229 | 241 | var $titleEl = this.getTitleElement(); |
|
0 commit comments