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
c030494e
Commit
c030494e
authored
Mar 01, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests and simplify code for showing controlbox
parent
4f2125c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
converse.js
converse.js
+8
-15
No files found.
converse.js
View file @
c030494e
...
...
@@ -644,7 +644,7 @@
this
.
ChatBox
=
Backbone
.
Model
.
extend
({
initialize
:
function
()
{
var
height
;
var
height
=
converse
.
applyHeightResistance
(
this
.
get
(
'
height
'
))
;
if
(
this
.
get
(
'
box_id
'
)
!==
'
controlbox
'
)
{
this
.
messages
=
new
converse
.
Messages
();
this
.
messages
.
localStorage
=
new
Backbone
.
LocalStorage
(
...
...
@@ -654,8 +654,10 @@
'
box_id
'
:
hex_sha1
(
this
.
get
(
'
jid
'
)),
'
otr_status
'
:
this
.
get
(
'
otr_status
'
)
||
UNENCRYPTED
,
'
minimized
'
:
this
.
get
(
'
minimized
'
)
||
false
,
'
height
'
:
converse
.
applyHeightResistance
(
this
.
get
(
'
height
'
))
'
height
'
:
height
});
}
else
{
this
.
set
({
'
height
'
:
height
});
}
},
...
...
@@ -1786,18 +1788,10 @@
this
.
featureAdded
(
feature
);
}
}
if
(
_
.
has
(
item
.
changed
,
'
visible
'
))
{
if
(
item
.
changed
.
visible
===
true
)
{
this
.
show
();
}
}
},
this
));
this
.
model
.
on
(
'
show
'
,
this
.
show
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
hide
,
this
);
this
.
model
.
on
(
'
hide
'
,
this
.
hide
,
this
);
if
(
this
.
model
.
get
(
'
visible
'
))
{
this
.
show
();
}
},
render
:
function
()
{
...
...
@@ -2402,7 +2396,7 @@
}
this
.
get
(
'
controlbox
'
).
fetch
();
// This line below will make sure the Roster is set up
this
.
get
(
'
controlbox
'
).
s
ave
({
connected
:
true
});
this
.
get
(
'
controlbox
'
).
s
et
({
connected
:
true
});
this
.
registerMessageHandler
();
// Get cached chatboxes from localstorage
this
.
fetch
({
...
...
@@ -2410,7 +2404,7 @@
success
:
$
.
proxy
(
function
(
collection
,
resp
)
{
if
(
_
.
include
(
_
.
pluck
(
resp
,
'
id
'
),
'
controlbox
'
))
{
// If the controlbox was saved in localstorage, it must be visible
this
.
get
(
'
controlbox
'
).
set
({
visible
:
true
}).
save
(
);
this
.
get
(
'
controlbox
'
).
trigger
(
'
show
'
);
}
},
this
)
});
...
...
@@ -3437,15 +3431,14 @@
converse
.
chatboxes
.
add
({
id
:
'
controlbox
'
,
box_id
:
'
controlbox
'
,
visible
:
true
,
height
:
converse
.
default_box_height
});
controlbox
=
converse
.
chatboxes
.
get
(
'
controlbox
'
);
if
(
converse
.
connection
)
{
converse
.
chatboxes
.
get
(
'
controlbox
'
).
save
();
}
}
else
{
controlbox
.
trigger
(
'
show
'
);
}
controlbox
.
trigger
(
'
show
'
);
},
onClick
:
function
(
e
)
{
...
...
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