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
aab963ba
Commit
aab963ba
authored
Oct 14, 2015
by
Remo Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed react addons classset deprecated
parent
74433b6e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
6 deletions
+54
-6
examples/react/index.html
examples/react/index.html
+1
-0
examples/react/js/footer.jsx
examples/react/js/footer.jsx
+3
-5
examples/react/js/todoItem.jsx
examples/react/js/todoItem.jsx
+1
-1
examples/react/node_modules/classnames/index.js
examples/react/node_modules/classnames/index.js
+48
-0
examples/react/package.json
examples/react/package.json
+1
-0
No files found.
examples/react/index.html
View file @
aab963ba
...
...
@@ -16,6 +16,7 @@
<script
src=
"node_modules/todomvc-common/base.js"
></script>
<script
src=
"node_modules/react/dist/react-with-addons.js"
></script>
<script
src=
"node_modules/classnames/index.js"
></script>
<script
src=
"node_modules/react/dist/JSXTransformer.js"
></script>
<script
src=
"node_modules/director/build/director.js"
></script>
...
...
examples/react/js/footer.jsx
View file @
aab963ba
...
...
@@ -23,8 +23,6 @@ var app = app || {};
);
}
// React idiom for shortcutting to `classSet` since it'll be used often
var
cx
=
React
.
addons
.
classSet
;
var
nowShowing
=
this
.
props
.
nowShowing
;
return
(
<
footer
className=
"footer"
>
...
...
@@ -35,7 +33,7 @@ var app = app || {};
<
li
>
<
a
href=
"#/"
className=
{
c
x
({
selected
:
nowShowing
===
app
.
ALL_TODOS
})
}
>
className=
{
c
lassNames
({
selected
:
nowShowing
===
app
.
ALL_TODOS
})
}
>
All
</
a
>
</
li
>
...
...
@@ -43,7 +41,7 @@ var app = app || {};
<
li
>
<
a
href=
"#/active"
className=
{
c
x
({
selected
:
nowShowing
===
app
.
ACTIVE_TODOS
})
}
>
className=
{
c
lassNames
({
selected
:
nowShowing
===
app
.
ACTIVE_TODOS
})
}
>
Active
</
a
>
</
li
>
...
...
@@ -51,7 +49,7 @@ var app = app || {};
<
li
>
<
a
href=
"#/completed"
className=
{
c
x
({
selected
:
nowShowing
===
app
.
COMPLETED_TODOS
})
}
>
className=
{
c
lassNames
({
selected
:
nowShowing
===
app
.
COMPLETED_TODOS
})
}
>
Completed
</
a
>
</
li
>
...
...
examples/react/js/todoItem.jsx
View file @
aab963ba
...
...
@@ -77,7 +77,7 @@ var app = app || {};
render
:
function
()
{
return
(
<
li
className=
{
React
.
addons
.
classSet
({
<
li
className=
{
classNames
({
completed
:
this
.
props
.
todo
.
completed
,
editing
:
this
.
props
.
editing
})
}
>
...
...
examples/react/node_modules/classnames/index.js
0 → 100644
View file @
aab963ba
/*!
Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(
function
()
{
'
use strict
'
;
var
hasOwn
=
{}.
hasOwnProperty
;
function
classNames
()
{
var
classes
=
''
;
for
(
var
i
=
0
;
i
<
arguments
.
length
;
i
++
)
{
var
arg
=
arguments
[
i
];
if
(
!
arg
)
continue
;
var
argType
=
typeof
arg
;
if
(
argType
===
'
string
'
||
argType
===
'
number
'
)
{
classes
+=
'
'
+
arg
;
}
else
if
(
Array
.
isArray
(
arg
))
{
classes
+=
'
'
+
classNames
.
apply
(
null
,
arg
);
}
else
if
(
argType
===
'
object
'
)
{
for
(
var
key
in
arg
)
{
if
(
hasOwn
.
call
(
arg
,
key
)
&&
arg
[
key
])
{
classes
+=
'
'
+
key
;
}
}
}
}
return
classes
.
substr
(
1
);
}
if
(
typeof
module
!==
'
undefined
'
&&
module
.
exports
)
{
module
.
exports
=
classNames
;
}
else
if
(
typeof
define
===
'
function
'
&&
typeof
define
.
amd
===
'
object
'
&&
define
.
amd
)
{
// register as 'classnames', consistent with npm package name
define
(
'
classnames
'
,
function
()
{
return
classNames
;
});
}
else
{
window
.
classNames
=
classNames
;
}
}());
examples/react/package.json
View file @
aab963ba
{
"private"
:
true
,
"dependencies"
:
{
"classnames"
:
"^2.1.5"
,
"director"
:
"^1.2.0"
,
"react"
:
"^0.13.3"
,
"todomvc-app-css"
:
"^2.0.0"
,
...
...
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