Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
f6a837cb
Commit
f6a837cb
authored
Jan 05, 2015
by
Chris Rebert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make $(document).tooltip({...}) without a `selector` throw an error
Closes #15484
parent
08410280
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
js/tests/unit/popover.js
js/tests/unit/popover.js
+7
-0
js/tests/unit/tooltip.js
js/tests/unit/tooltip.js
+6
-0
js/tooltip.js
js/tooltip.js
+4
-0
No files found.
js/tests/unit/popover.js
View file @
f6a837cb
...
@@ -225,4 +225,11 @@ $(function () {
...
@@ -225,4 +225,11 @@ $(function () {
})
})
.
bootstrapPopover
(
'
show
'
)
.
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!
'
))
})
})
})
js/tests/unit/tooltip.js
View file @
f6a837cb
...
@@ -1107,4 +1107,10 @@ $(function () {
...
@@ -1107,4 +1107,10 @@ $(function () {
$element
.
bootstrapTooltip
(
'
show
'
)
$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!
'
))
})
})
})
js/tooltip.js
View file @
f6a837cb
...
@@ -52,6 +52,10 @@
...
@@ -52,6 +52,10 @@
this
.
options
=
this
.
getOptions
(
options
)
this
.
options
=
this
.
getOptions
(
options
)
this
.
$viewport
=
this
.
options
.
viewport
&&
$
(
this
.
options
.
viewport
.
selector
||
this
.
options
.
viewport
)
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
(
'
'
)
var
triggers
=
this
.
options
.
trigger
.
split
(
'
'
)
for
(
var
i
=
triggers
.
length
;
i
--
;)
{
for
(
var
i
=
triggers
.
length
;
i
--
;)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment