Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tvgids
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
tvgids
Commits
7bca830d
Commit
7bca830d
authored
Dec 30, 2013
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue of no channels being selected when local storage is unitialized
parent
6ad0782d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
guide.coffee
guide.coffee
+5
-6
No files found.
guide.coffee
View file @
7bca830d
...
@@ -46,10 +46,6 @@ ChannelList = Backbone.Collection.extend(
...
@@ -46,10 +46,6 @@ ChannelList = Backbone.Collection.extend(
model
:
Channel
model
:
Channel
comparator
:
(
a
,
b
)
->
parseInt
(
a
.
get
(
'id'
))
-
parseInt
(
b
.
get
(
'id'
))
comparator
:
(
a
,
b
)
->
parseInt
(
a
.
get
(
'id'
))
-
parseInt
(
b
.
get
(
'id'
))
initialize
:
(
models
,
options
)
->
@
visible
=
if
localStorage
.
hasOwnProperty
(
STORAGE_NAME
)
\
then
localStorage
.
getItem
(
STORAGE_NAME
).
split
(
','
)
else
@
pluck
(
'id'
)
fetch
:
->
fetch
:
->
@
reset
(
CHANNELS
)
@
reset
(
CHANNELS
)
#@reset(CHANNELS.slice(0,3))
#@reset(CHANNELS.slice(0,3))
...
@@ -57,12 +53,15 @@ ChannelList = Backbone.Collection.extend(
...
@@ -57,12 +53,15 @@ ChannelList = Backbone.Collection.extend(
@
propagateVisible
()
@
propagateVisible
()
propagateVisible
:
->
propagateVisible
:
->
for
id
in
@
visible
visible
=
if
localStorage
.
hasOwnProperty
(
STORAGE_NAME
)
\
then
localStorage
.
getItem
(
STORAGE_NAME
).
split
(
','
)
else
@
pluck
(
'id'
)
for
id
in
visible
if
@
length
and
not
@
findWhere
(
id
:
id
)
if
@
length
and
not
@
findWhere
(
id
:
id
)
console
.
log
'not found:'
,
id
,
typeof
id
,
typeof
@
at
(
0
).
get
(
'id'
)
console
.
log
'not found:'
,
id
,
typeof
id
,
typeof
@
at
(
0
).
get
(
'id'
)
@
findWhere
(
id
:
id
)
?
.
set
(
visible
:
true
)
@
findWhere
(
id
:
id
)
?
.
set
(
visible
:
true
)
for
id
in
_
.
difference
(
@
pluck
(
'id'
),
@
visible
)
for
id
in
_
.
difference
(
@
pluck
(
'id'
),
visible
)
if
not
@
findWhere
(
id
:
id
)
if
not
@
findWhere
(
id
:
id
)
console
.
log
'not found:'
,
id
console
.
log
'not found:'
,
id
@
findWhere
(
id
:
id
)
?
.
set
(
visible
:
false
)
@
findWhere
(
id
:
id
)
?
.
set
(
visible
:
false
)
...
...
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