1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 12:59:05 +02:00

Make $(document).tooltip({...}) without a selector throw an error

Closes #15484
This commit is contained in:
Chris Rebert
2015-01-05 14:22:49 -08:00
parent 0841028009
commit f6a837cbf1
3 changed files with 17 additions and 0 deletions

View File

@@ -52,6 +52,10 @@
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--;) {