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
044907e4
Commit
044907e4
authored
Mar 14, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Looks like `focus` parameter was never used.
parent
401513e6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
22 deletions
+20
-22
spec/chatbox.js
spec/chatbox.js
+11
-9
src/converse-chatview.js
src/converse-chatview.js
+5
-8
src/converse-muc-views.js
src/converse-muc-views.js
+4
-5
No files found.
spec/chatbox.js
View file @
044907e4
...
@@ -224,16 +224,19 @@
...
@@ -224,16 +224,19 @@
// visible, but no other chat boxes have been created.
// visible, but no other chat boxes have been created.
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
1
);
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
1
);
spyOn
(
_converse
.
ChatBoxView
.
prototype
,
'
focus
'
);
chatbox
=
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
chatbox
=
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
$el
=
$
(
_converse
.
rosterview
.
el
).
find
(
'
a.open-chat:contains("
'
+
chatbox
.
get
(
'
fullname
'
)
+
'
")
'
);
$el
=
$
(
_converse
.
rosterview
.
el
).
find
(
'
a.open-chat:contains("
'
+
chatbox
.
get
(
'
fullname
'
)
+
'
")
'
);
jid
=
$el
.
text
().
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
jid
=
$el
.
text
().
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
spyOn
(
_converse
,
'
emit
'
);
$el
[
0
].
click
();
$el
[
0
].
click
();
test_utils
.
waitUntil
(
function
()
{
return
_converse
.
emit
.
calls
.
count
();
},
300
).
then
(
function
()
{
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
2
);
expect
(
_converse
.
chatboxes
.
length
).
toEqual
(
2
);
var
chatboxview
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
expect
(
_converse
.
emit
).
toHaveBeenCalledWith
(
'
chatBoxFocused
'
,
jasmine
.
any
(
Object
));
expect
(
chatboxview
.
focus
).
toHaveBeenCalled
();
done
();
done
();
});
}));
}));
...
@@ -281,8 +284,7 @@
...
@@ -281,8 +284,7 @@
test_utils
.
openControlBox
();
test_utils
.
openControlBox
();
test_utils
.
waitUntil
(
function
()
{
test_utils
.
waitUntil
(
function
()
{
return
$
(
_converse
.
rosterview
.
el
).
find
(
'
.roster-group
'
).
length
;
return
$
(
_converse
.
rosterview
.
el
).
find
(
'
.roster-group
'
).
length
;
},
300
)
},
300
).
then
(
function
()
{
.
then
(
function
()
{
var
chatbox
=
test_utils
.
openChatBoxes
(
_converse
,
1
)[
0
],
var
chatbox
=
test_utils
.
openChatBoxes
(
_converse
,
1
)[
0
],
controlview
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
),
// The controlbox is currently open
controlview
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
),
// The controlbox is currently open
chatview
=
_converse
.
chatboxviews
.
get
(
chatbox
.
get
(
'
jid
'
));
chatview
=
_converse
.
chatboxviews
.
get
(
chatbox
.
get
(
'
jid
'
));
...
...
src/converse-chatview.js
View file @
044907e4
...
@@ -1083,7 +1083,7 @@
...
@@ -1083,7 +1083,7 @@
return
this
;
return
this
;
},
},
afterShown
(
focus
)
{
afterShown
()
{
if
(
u
.
isPersistableModel
(
this
.
model
))
{
if
(
u
.
isPersistableModel
(
this
.
model
))
{
this
.
model
.
clearUnreadMsgCounter
();
this
.
model
.
clearUnreadMsgCounter
();
this
.
model
.
save
();
this
.
model
.
save
();
...
@@ -1091,21 +1091,18 @@
...
@@ -1091,21 +1091,18 @@
this
.
setChatState
(
_converse
.
ACTIVE
);
this
.
setChatState
(
_converse
.
ACTIVE
);
this
.
renderEmojiPicker
();
this
.
renderEmojiPicker
();
this
.
scrollDown
();
this
.
scrollDown
();
if
(
focus
)
{
this
.
focus
();
}
},
},
_show
(
f
ocus
)
{
_show
(
f
)
{
/* Inner show method that gets debounced */
/* Inner show method that gets debounced */
if
(
u
.
isVisible
(
this
.
el
))
{
if
(
u
.
isVisible
(
this
.
el
))
{
if
(
focus
)
{
this
.
focus
();
}
this
.
focus
();
return
;
return
;
}
}
u
.
fadeIn
(
this
.
el
,
_
.
bind
(
this
.
afterShown
,
this
,
focus
));
u
.
fadeIn
(
this
.
el
,
_
.
bind
(
this
.
afterShown
,
this
));
},
},
show
(
focus
)
{
show
()
{
if
(
_
.
isUndefined
(
this
.
debouncedShow
))
{
if
(
_
.
isUndefined
(
this
.
debouncedShow
))
{
/* We wrap the method in a debouncer and set it on the
/* We wrap the method in a debouncer and set it on the
* instance, so that we have it debounced per instance.
* instance, so that we have it debounced per instance.
...
...
src/converse-muc-views.js
View file @
044907e4
...
@@ -517,7 +517,7 @@
...
@@ -517,7 +517,7 @@
}));
}));
},
},
afterShown
(
focus
)
{
afterShown
()
{
/* Override from converse-chatview, specifically to avoid
/* Override from converse-chatview, specifically to avoid
* the 'active' chat state from being sent out prematurely.
* the 'active' chat state from being sent out prematurely.
*
*
...
@@ -530,18 +530,17 @@
...
@@ -530,18 +530,17 @@
this
.
occupantsview
.
setOccupantsHeight
();
this
.
occupantsview
.
setOccupantsHeight
();
this
.
scrollDown
();
this
.
scrollDown
();
this
.
renderEmojiPicker
();
this
.
renderEmojiPicker
();
if
(
focus
)
{
this
.
focus
();
}
},
},
show
(
focus
)
{
show
()
{
if
(
u
.
isVisible
(
this
.
el
))
{
if
(
u
.
isVisible
(
this
.
el
))
{
if
(
focus
)
{
this
.
focus
();
}
this
.
focus
();
return
;
return
;
}
}
// Override from converse-chatview in order to not use
// Override from converse-chatview in order to not use
// "fadeIn", which causes flashing.
// "fadeIn", which causes flashing.
u
.
showElement
(
this
.
el
);
u
.
showElement
(
this
.
el
);
this
.
afterShown
(
focus
);
this
.
afterShown
();
},
},
afterConnected
()
{
afterConnected
()
{
...
...
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