File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -677,7 +677,7 @@ <h3>Options</h3>
677
677
< td > content</ td >
678
678
< td > string, function</ td >
679
679
< td > 'data-content'</ td >
680
- < td > a string or method for retrieving content text. if none are provided, content will be sourced from a data-content attribute .</ td >
680
+ < td > attribute or method for retrieving content text.</ td >
681
681
</ tr >
682
682
< tr >
683
683
< td > trigger</ td >
Original file line number Diff line number Diff line change 51
51
, o = this . options
52
52
53
53
if ( typeof this . options . content == 'string' ) {
54
- content = this . options . content
54
+ content = $e . attr ( this . options . content )
55
55
} else if ( typeof this . options . content == 'function' ) {
56
56
content = this . options . content . call ( this . $element [ 0 ] )
57
57
}
58
+
58
59
return content
59
60
}
60
61
80
81
81
82
$ . fn . popover . defaults = $ . extend ( { } , $ . fn . twipsy . defaults , {
82
83
placement : 'right'
84
+ , content : 'data-content'
83
85
, template : '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
84
86
} )
85
87
88
+ $ . fn . twipsy . rejectAttrOptions . push ( 'content' )
89
+
86
90
} ( window . jQuery || window . ender ) ;
Original file line number Diff line number Diff line change 304
304
, template : '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
305
305
}
306
306
307
+ $ . fn . twipsy . rejectAttrOptions = [ 'title' ]
308
+
307
309
$ . fn . twipsy . elementOptions = function ( ele , options ) {
308
- return $ . extend ( { } , options , $ ( ele ) . data ( ) )
310
+ var data = $ ( ele ) . data ( )
311
+ , rejects = $ . fn . twipsy . rejectAttrOptions
312
+ , i = rejects . length
313
+
314
+ while ( i -- ) {
315
+ delete data [ rejects [ i ] ]
316
+ }
317
+
318
+ return $ . extend ( { } , options , data )
309
319
}
310
320
311
321
} ( window . jQuery || window . ender ) ;
You can’t perform that action at this time.
0 commit comments