Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
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
Eugene Shen
todomvc
Commits
13e65b74
Commit
13e65b74
authored
Sep 20, 2012
by
Ryan Eastridge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update thorax
parent
561b501e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
labs/architecture-examples/thorax/js/lib/thorax.js
labs/architecture-examples/thorax/js/lib/thorax.js
+3
-9
No files found.
labs/architecture-examples/thorax/js/lib/thorax.js
View file @
13e65b74
...
@@ -1107,14 +1107,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
...
@@ -1107,14 +1107,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
}
else
{
}
else
{
//use last() as appendItem can accept multiple nodes from a template
//use last() as appendItem can accept multiple nodes from a template
var
last
=
this
.
$el
.
find
(
'
[
'
+
modelCidAttributeName
+
'
="
'
+
previousModel
.
cid
+
'
"]
'
).
last
();
var
last
=
this
.
$el
.
find
(
'
[
'
+
modelCidAttributeName
+
'
="
'
+
previousModel
.
cid
+
'
"]
'
).
last
();
if
(
last
.
length
)
{
last
.
after
(
itemElement
);
last
.
after
(
itemElement
);
}
else
{
//TODO: this is a hack to make item filtering work since the previous
//query may not find an element if it was filtered, should re-write
//filtering and tests to use hide/show
this
.
$el
.
prepend
(
itemElement
);
}
}
}
this
.
_appendViews
(
null
,
function
(
el
)
{
this
.
_appendViews
(
null
,
function
(
el
)
{
el
.
setAttribute
(
modelCidAttributeName
,
model
.
cid
);
el
.
setAttribute
(
modelCidAttributeName
,
model
.
cid
);
...
@@ -1125,6 +1118,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
...
@@ -1125,6 +1118,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
if
(
!
options
.
silent
)
{
if
(
!
options
.
silent
)
{
this
.
parent
.
trigger
(
'
rendered:item
'
,
this
,
this
.
collection
,
model
,
itemElement
,
index
);
this
.
parent
.
trigger
(
'
rendered:item
'
,
this
,
this
.
collection
,
model
,
itemElement
,
index
);
}
}
applyItemVisiblityFilter
.
call
(
this
,
model
);
}
}
return
itemView
;
return
itemView
;
},
},
...
@@ -1162,6 +1156,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
...
@@ -1162,6 +1156,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
},
this
);
},
this
);
}
}
this
.
parent
.
trigger
(
'
rendered:collection
'
,
this
,
this
.
collection
);
this
.
parent
.
trigger
(
'
rendered:collection
'
,
this
,
this
.
collection
);
applyVisibilityFilter
.
call
(
this
);
}
}
++
this
.
_renderCount
;
++
this
.
_renderCount
;
},
},
...
@@ -1324,7 +1319,6 @@ Thorax.View.on({
...
@@ -1324,7 +1319,6 @@ Thorax.View.on({
if
(
collectionView
.
$el
.
length
)
{
if
(
collectionView
.
$el
.
length
)
{
var
index
=
collection
.
indexOf
(
model
);
var
index
=
collection
.
indexOf
(
model
);
collectionView
.
appendItem
(
model
,
index
);
collectionView
.
appendItem
(
model
,
index
);
applyItemVisiblityFilter
.
call
(
collectionView
,
model
);
}
}
},
},
remove
:
function
(
collectionView
,
model
,
collection
)
{
remove
:
function
(
collectionView
,
model
,
collection
)
{
...
...
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