Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
solr-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
716f1e9b
authored
2016-11-15 12:23:16 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Set Facet.{itemCount,checkedCount}.
1 parent
bda1adc2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
src/scripts/solr/model/Facet.js
src/scripts/solr/model/Facet.js
View file @
716f1e9
...
...
@@ -30,6 +30,8 @@ define(function(require) {
var
Facet
=
Backbone
.
Model
.
extend
({
defaults
:
function
defaults
()
{
return
{
itemCount
:
0
,
checkedCount
:
0
,
checkedKeys
:
[],
formName
:
null
,
query
:
null
,
...
...
@@ -67,6 +69,7 @@ define(function(require) {
try
{
this
.
set
({
all
:
checkedCount
===
0
,
checkedCount
:
checkedCount
,
checkedKeys
:
checkedKeys
,
});
...
...
@@ -120,6 +123,7 @@ define(function(require) {
});
this
.
set
({
all
:
checkedCount
===
0
,
checkedCount
:
checkedCount
,
});
}
finally
{
skipCallback
=
null
;
...
...
@@ -180,12 +184,19 @@ define(function(require) {
items
.
sort
();
},
this
);
this
.
set
(
'items'
,
new
ItemCollection
([]));
var
items
=
new
ItemCollection
([]);
this
.
set
(
'items'
,
items
);
this
.
set
(
'comparator'
,
options
.
comparator
,
{
silent
:
true
});
this
.
trigger
(
'change:comparator'
);
this
.
get
(
'items'
)
.
on
(
'item-change'
,
function
(
model
,
value
,
options
)
{
items
.
on
(
'item-change'
,
function
(
model
,
value
,
options
)
{
this
.
trigger
(
'item-change'
,
null
,
null
,
options
);
},
this
);
items
.
on
(
'update'
,
function
(
model
,
value
,
options
)
{
var
items
=
this
.
get
(
'items'
);
this
.
set
({
itemCount
:
items
.
length
,
});
},
this
);
this
.
facetType
=
options
.
facetType
;
this
.
facetStats
=
options
.
facetStats
;
this
.
other
=
options
.
other
;
...
...
Please
register
or
sign in
to post a comment