File tree 3 files changed +17
-3
lines changed
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -683,7 +683,7 @@ <h3>Options</h3>
683
683
< td > content</ td >
684
684
< td > string, function</ td >
685
685
< td > 'data-content'</ td >
686
- < td > a string or method for retrieving content text. if none are provided, content will be sourced from a data-content attribute .</ td >
686
+ < td > attribute or method for retrieving content text.</ td >
687
687
</ tr >
688
688
< tr >
689
689
< 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
, titleSelector : '.title'
85
87
, contentSelector : '.content p'
86
88
} )
87
89
90
+ $ . fn . twipsy . rejectAttrOptions . push ( 'content' )
91
+
88
92
} ( window . jQuery || window . ender ) ;
Original file line number Diff line number Diff line change 305
305
, contentSelector : '.twipsy-inner'
306
306
}
307
307
308
+ $ . fn . twipsy . rejectAttrOptions = [ 'title' ]
309
+
308
310
$ . fn . twipsy . elementOptions = function ( ele , options ) {
309
- return $ . extend ( { } , options , $ ( ele ) . data ( ) )
311
+ var data = $ ( ele ) . data ( )
312
+ , rejects = $ . fn . twipsy . rejectAttrOptions
313
+ , i = rejects . length
314
+
315
+ while ( i -- ) {
316
+ delete data [ rejects [ i ] ]
317
+ }
318
+
319
+ return $ . extend ( { } , options , data )
310
320
}
311
321
312
322
} ( window . jQuery || window . ender ) ;
You can’t perform that action at this time.
0 commit comments