})
.bootstrapPopover('show')
})
+
+ test('should throw an error when initializing popover on the document object without specifying a delegation selector', function () {
+ throws(function () {
+ $(document).bootstrapPopover({ title: 'What am I on?', content: 'My selector is missing' })
+ }, new Error('`selector` option must be specified when initializing popover on the window.document object!'))
+ })
+
})
$element.bootstrapTooltip('show')
})
+ test('should throw an error when initializing tooltip on the document object without specifying a delegation selector', function () {
+ throws(function () {
+ $(document).bootstrapTooltip({ title: 'What am I on?' })
+ }, new Error('`selector` option must be specified when initializing tooltip on the window.document object!'))
+ })
+
})
this.options = this.getOptions(options)
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
+ if (this.$element[0] instanceof window.Document && !this.options.selector) {
+ throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!');
+ }
+
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) {