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
eaa67dab
Commit
eaa67dab
authored
Jan 07, 2021
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Filtering of contacts stopped working after refactoring
parent
68070166
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
src/plugins/rosterview/filterview.js
src/plugins/rosterview/filterview.js
+7
-6
src/plugins/rosterview/rosterview.js
src/plugins/rosterview/rosterview.js
+2
-2
No files found.
src/plugins/rosterview/filterview.js
View file @
eaa67dab
...
@@ -5,7 +5,6 @@ import { _converse, api } from "@converse/headless/core";
...
@@ -5,7 +5,6 @@ import { _converse, api } from "@converse/headless/core";
import
{
debounce
}
from
"
lodash-es
"
;
import
{
debounce
}
from
"
lodash-es
"
;
import
{
render
}
from
'
lit-html
'
;
import
{
render
}
from
'
lit-html
'
;
export
const
RosterFilter
=
Model
.
extend
({
export
const
RosterFilter
=
Model
.
extend
({
initialize
()
{
initialize
()
{
this
.
set
({
this
.
set
({
...
@@ -13,10 +12,9 @@ export const RosterFilter = Model.extend({
...
@@ -13,10 +12,9 @@ export const RosterFilter = Model.extend({
'
filter_type
'
:
'
contacts
'
,
'
filter_type
'
:
'
contacts
'
,
'
chat_state
'
:
'
online
'
'
chat_state
'
:
'
online
'
});
});
}
,
}
});
});
export
class
RosterFilterView
extends
ElementView
{
export
class
RosterFilterView
extends
ElementView
{
tagName
=
'
span
'
;
tagName
=
'
span
'
;
...
@@ -30,8 +28,12 @@ export class RosterFilterView extends ElementView {
...
@@ -30,8 +28,12 @@ export class RosterFilterView extends ElementView {
this
.
model
.
save
({
'
filter_text
'
:
this
.
querySelector
(
'
.roster-filter
'
).
value
});
this
.
model
.
save
({
'
filter_text
'
:
this
.
querySelector
(
'
.roster-filter
'
).
value
});
},
250
);
},
250
);
this
.
listenTo
(
this
.
model
,
'
change:filter_type
'
,
this
.
render
);
this
.
listenTo
(
this
.
model
,
'
change
'
,
this
.
render
);
this
.
listenTo
(
this
.
model
,
'
change:filter_text
'
,
this
.
render
);
this
.
listenTo
(
this
.
model
,
'
change
'
,
()
=>
this
.
dispatchEvent
(
new
CustomEvent
(
'
update
'
,
{
'
detail
'
:
this
.
model
.
changed
}))
);
this
.
listenTo
(
_converse
.
roster
,
"
add
"
,
this
.
render
);
this
.
listenTo
(
_converse
.
roster
,
"
add
"
,
this
.
render
);
this
.
listenTo
(
_converse
.
roster
,
"
destroy
"
,
this
.
render
);
this
.
listenTo
(
_converse
.
roster
,
"
destroy
"
,
this
.
render
);
...
@@ -102,5 +104,4 @@ export class RosterFilterView extends ElementView {
...
@@ -102,5 +104,4 @@ export class RosterFilterView extends ElementView {
}
}
}
}
api
.
elements
.
define
(
'
converse-roster-filter
'
,
RosterFilterView
);
api
.
elements
.
define
(
'
converse-roster-filter
'
,
RosterFilterView
);
src/plugins/rosterview/rosterview.js
View file @
eaa67dab
...
@@ -80,7 +80,7 @@ const RosterView = OrderedListView.extend({
...
@@ -80,7 +80,7 @@ const RosterView = OrderedListView.extend({
listenToRosterFilter
()
{
listenToRosterFilter
()
{
this
.
filter_view
=
this
.
el
.
querySelector
(
'
converse-roster-filter
'
);
this
.
filter_view
=
this
.
el
.
querySelector
(
'
converse-roster-filter
'
);
this
.
listenTo
(
this
.
filter_view
.
model
,
'
change
'
,
this
.
updateFilter
);
this
.
filter_view
.
addEventListener
(
'
update
'
,
()
=>
this
.
updateFilter
()
);
},
},
/**
/**
...
@@ -91,6 +91,7 @@ const RosterView = OrderedListView.extend({
...
@@ -91,6 +91,7 @@ const RosterView = OrderedListView.extend({
* contact fetched from browser storage.
* contact fetched from browser storage.
*/
*/
updateFilter
:
debounce
(
function
()
{
updateFilter
:
debounce
(
function
()
{
this
.
filter_view
=
this
.
el
.
querySelector
(
'
converse-roster-filter
'
);
const
type
=
this
.
filter_view
.
model
.
get
(
'
filter_type
'
);
const
type
=
this
.
filter_view
.
model
.
get
(
'
filter_type
'
);
if
(
type
===
'
state
'
)
{
if
(
type
===
'
state
'
)
{
this
.
filter
(
this
.
filter_view
.
model
.
get
(
'
chat_state
'
),
type
);
this
.
filter
(
this
.
filter_view
.
model
.
get
(
'
chat_state
'
),
type
);
...
@@ -103,7 +104,6 @@ const RosterView = OrderedListView.extend({
...
@@ -103,7 +104,6 @@ const RosterView = OrderedListView.extend({
if
(
!
u
.
isVisible
(
this
.
roster_el
))
{
if
(
!
u
.
isVisible
(
this
.
roster_el
))
{
u
.
showElement
(
this
.
roster_el
);
u
.
showElement
(
this
.
roster_el
);
}
}
// this.filter_view.render();
return
this
;
return
this
;
},
},
...
...
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