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
ea9665df
Commit
ea9665df
authored
Mar 31, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the option sticky_controlbox, to disable closing it.
updates #622
parent
a4779704
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
docs/source/configuration.rst
docs/source/configuration.rst
+15
-0
src/converse-controlbox.js
src/converse-controlbox.js
+6
-2
src/templates/controlbox.html
src/templates/controlbox.html
+3
-1
No files found.
docs/source/configuration.rst
View file @
ea9665df
...
@@ -773,6 +773,21 @@ Data in localStorage on the other hand is kept indefinitely.
...
@@ -773,6 +773,21 @@ Data in localStorage on the other hand is kept indefinitely.
roster contact statuses will not become out of sync in a single session,
roster contact statuses will not become out of sync in a single session,
only across more than one session.
only across more than one session.
sticky_controlbox
-----------------
* Default: ``false``
If set to ``true``, the control box (which includes the login, registration,
contacts and rooms tabs) will not be closeable. It won't have a close button at
all.
The idea behind this setting is to provide a better experience on mobile
devices when the intent is to use converse.js as a web app. In this case
it doesn't make sense to close the control box, as there's often then nothing
"behind" it that's relevant to the user.
strict_plugin_dependencies
strict_plugin_dependencies
--------------------------
--------------------------
...
...
src/converse-controlbox.js
View file @
ea9665df
...
@@ -159,6 +159,7 @@
...
@@ -159,6 +159,7 @@
allow_logout
:
true
,
allow_logout
:
true
,
default_domain
:
undefined
,
default_domain
:
undefined
,
show_controlbox_by_default
:
false
,
show_controlbox_by_default
:
false
,
sticky_controlbox
:
false
,
xhr_user_search
:
false
,
xhr_user_search
:
false
,
xhr_user_search_url
:
''
xhr_user_search_url
:
''
});
});
...
@@ -216,6 +217,11 @@
...
@@ -216,6 +217,11 @@
},
},
render
:
function
()
{
render
:
function
()
{
this
.
$el
.
html
(
converse
.
templates
.
controlbox
(
_
.
extend
(
this
.
model
.
toJSON
(),
{
sticky_controlbox
:
converse
.
sticky_controlbox
}))
);
if
(
!
converse
.
connection
.
connected
||
!
converse
.
connection
.
authenticated
||
converse
.
connection
.
disconnecting
)
{
if
(
!
converse
.
connection
.
connected
||
!
converse
.
connection
.
authenticated
||
converse
.
connection
.
disconnecting
)
{
// TODO: we might need to take prebinding into consideration here.
// TODO: we might need to take prebinding into consideration here.
this
.
renderLoginPanel
();
this
.
renderLoginPanel
();
...
@@ -254,7 +260,6 @@
...
@@ -254,7 +260,6 @@
renderLoginPanel
:
function
()
{
renderLoginPanel
:
function
()
{
var
$feedback
=
this
.
$
(
'
.conn-feedback
'
);
// we want to still show any existing feedback.
var
$feedback
=
this
.
$
(
'
.conn-feedback
'
);
// we want to still show any existing feedback.
this
.
$el
.
html
(
converse
.
templates
.
controlbox
(
this
.
model
.
toJSON
()));
var
cfg
=
{
var
cfg
=
{
'
$parent
'
:
this
.
$el
.
find
(
'
.controlbox-panes
'
),
'
$parent
'
:
this
.
$el
.
find
(
'
.controlbox-panes
'
),
'
model
'
:
this
'
model
'
:
this
...
@@ -273,7 +278,6 @@
...
@@ -273,7 +278,6 @@
},
},
renderContactsPanel
:
function
()
{
renderContactsPanel
:
function
()
{
this
.
$el
.
html
(
converse
.
templates
.
controlbox
(
this
.
model
.
toJSON
()));
this
.
contactspanel
=
new
converse
.
ContactsPanel
({
this
.
contactspanel
=
new
converse
.
ContactsPanel
({
'
$parent
'
:
this
.
$el
.
find
(
'
.controlbox-panes
'
)
'
$parent
'
:
this
.
$el
.
find
(
'
.controlbox-panes
'
)
});
});
...
...
src/templates/controlbox.html
View file @
ea9665df
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
<div
class=
"dragresize dragresize-left"
></div>
<div
class=
"dragresize dragresize-left"
></div>
<div
class=
"chat-head controlbox-head"
>
<div
class=
"chat-head controlbox-head"
>
<ul
id=
"controlbox-tabs"
></ul>
<ul
id=
"controlbox-tabs"
></ul>
{[ if (!sticky_controlbox) { ]}
<a
class=
"chatbox-btn close-chatbox-button icon-close"
></a>
<a
class=
"chatbox-btn close-chatbox-button icon-close"
></a>
{[ } ]}
</div>
</div>
<div
class=
"controlbox-panes"
></div>
<div
class=
"controlbox-panes"
></div>
</div>
</div>
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