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
fc48e029
Commit
fc48e029
authored
Oct 06, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More lazily render the bookmarks list
Could still be improved.
parent
ee6c5dbf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
19 deletions
+15
-19
css/converse.css
css/converse.css
+1
-1
sass/_bookmarks.scss
sass/_bookmarks.scss
+1
-2
sass/_controlbox.scss
sass/_controlbox.scss
+2
-0
spec/bookmarks.js
spec/bookmarks.js
+2
-0
src/converse-bookmarks.js
src/converse-bookmarks.js
+9
-16
No files found.
css/converse.css
View file @
fc48e029
...
...
@@ -2175,7 +2175,7 @@
color
:
#818479
;
margin-bottom
:
0.5em
;
}
#conversejs
#controlbox
.bookmarks-list
.bookmarks
li
{
padding
:
0.
3
em
1em
;
}
padding
:
0.
1
em
1em
;
}
#conversejs
#controlbox
.bookmarks-list
.bookmarks
li
.open-room
{
display
:
inline-block
;
overflow
:
hidden
;
...
...
sass/_bookmarks.scss
View file @
fc48e029
#conversejs
{
#controlbox
{
.bookmarks-list
{
margin-top
:
2em
;
.bookmarks-toggle
{
display
:
block
;
font-weight
:
bold
;
...
...
@@ -10,7 +9,7 @@
}
.bookmarks
{
li
{
padding
:
0
.
3
em
1em
;
padding
:
0
.
1
em
1em
;
.open-room
{
display
:
inline-block
;
overflow
:
hidden
;
...
...
sass/_controlbox.scss
View file @
fc48e029
...
...
@@ -108,6 +108,8 @@
}
#chatrooms
{
padding-top
:
2em
;
form
.add-chatroom
{
input
[
type
=
button
],
input
[
type
=
submit
],
...
...
spec/bookmarks.js
View file @
fc48e029
...
...
@@ -385,6 +385,8 @@
describe
(
"
The rooms panel
"
,
function
()
{
beforeEach
(
function
()
{
test_utils
.
openRoomsPanel
();
converse
.
bookmarks
.
reset
();
converse
.
chatboxviews
.
get
(
'
controlbox
'
).
$
(
'
#chatrooms ul.bookmarks
'
).
html
(
''
);
});
it
(
"
shows a list of bookmarks
"
,
function
()
{
...
...
src/converse-bookmarks.js
View file @
fc48e029
...
...
@@ -312,12 +312,6 @@
'
label_bookmarks
'
:
__
(
'
Bookmarked Rooms
'
)
}));
this
.
$bookmarks
=
this
.
$
(
'
.bookmarks
'
);
var
controlboxview
=
converse
.
chatboxviews
.
get
(
'
controlbox
'
);
if
(
_
.
isUndefined
(
controlboxview
))
{
return
this
.
$el
;
}
controlboxview
.
$
(
'
#chatrooms .bookmarks-list
'
).
remove
();
this
.
$el
.
prependTo
(
controlboxview
.
$
(
'
#chatrooms
'
));
return
this
.
$el
;
},
...
...
@@ -332,18 +326,20 @@
},
onBookmarkAdded
:
function
(
item
)
{
if
(
_
.
isUndefined
(
this
.
$bookmarks
))
{
this
.
render
();
}
this
.
$bookmarks
.
append
(
$
(
converse
.
templates
.
bookmark
({
// TODO: Try to come up with a way to avoid DOM reflows.
var
$bookmark
=
$
(
converse
.
templates
.
bookmark
({
'
name
'
:
item
.
get
(
'
name
'
),
'
jid
'
:
item
.
get
(
'
jid
'
),
'
open_title
'
:
__
(
'
Click to open this room
'
),
'
info_title
'
:
__
(
'
Show more information on this room
'
),
'
info_remove
'
:
__
(
'
Remove this bookmark
'
)
})
));
}));
if
(
_
.
isUndefined
(
this
.
$bookmarks
))
{
this
.
render
();
var
controlboxview
=
converse
.
chatboxviews
.
get
(
'
controlbox
'
);
this
.
$el
.
prependTo
(
controlboxview
.
$
(
'
#chatrooms
'
));
}
this
.
$bookmarks
.
append
(
$bookmark
);
},
toggleBookmarksList
:
function
(
ev
)
{
...
...
@@ -365,9 +361,6 @@
{
'
model
'
:
converse
.
bookmarks
}
);
converse
.
bookmarks
.
fetchBookmarks
();
// TODO: think of performance here... we probably only want to
// show the bookmarks after they have been fetched
converse
.
bookmarksview
.
render
();
};
converse
.
on
(
'
connected
'
,
converse
.
initBookmarks
);
converse
.
on
(
'
reconnected
'
,
converse
.
initBookmarks
);
...
...
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