Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
7a1f62d3
Commit
7a1f62d3
authored
Oct 26, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move `isVisible` from core utils to html utils
parent
d5b5bac5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
src/headless/utils/core.js
src/headless/utils/core.js
+0
-8
src/utils/html.js
src/utils/html.js
+9
-0
No files found.
src/headless/utils/core.js
View file @
7a1f62d3
...
...
@@ -333,14 +333,6 @@ u.replaceCurrentWord = function (input, new_value) {
input
.
selectionEnd
=
cursor
-
current_word
.
length
+
new_value
.
length
+
1
;
};
u
.
isVisible
=
function
(
el
)
{
if
(
u
.
hasClass
(
'
hidden
'
,
el
))
{
return
false
;
}
// XXX: Taken from jQuery's "visible" implementation
return
el
.
offsetWidth
>
0
||
el
.
offsetHeight
>
0
||
el
.
getClientRects
().
length
>
0
;
};
u
.
triggerEvent
=
function
(
el
,
name
,
type
=
"
Event
"
,
bubbles
=
true
,
cancelable
=
true
)
{
const
evt
=
document
.
createEvent
(
type
);
evt
.
initEvent
(
name
,
bubbles
,
cancelable
);
...
...
src/utils/html.js
View file @
7a1f62d3
...
...
@@ -500,6 +500,15 @@ function afterAnimationEnds (el, callback) {
}
}
u
.
isVisible
=
function
(
el
)
{
if
(
u
.
hasClass
(
'
hidden
'
,
el
))
{
return
false
;
}
// XXX: Taken from jQuery's "visible" implementation
return
el
.
offsetWidth
>
0
||
el
.
offsetHeight
>
0
||
el
.
getClientRects
().
length
>
0
;
};
u
.
fadeIn
=
function
(
el
,
callback
)
{
if
(
_
.
isNil
(
el
))
{
logger
.
warn
(
"
Undefined or null element passed into fadeIn
"
);
...
...
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