Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
217 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,5 @@ spm_modules | |
.cache | ||
dist | ||
assets/**/*.css | ||
examples/**/*.css | ||
examples/**/*.css | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,5 @@ _site | |
sea-modules | ||
spm_modules | ||
.cache | ||
dist | ||
dist | ||
build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** @jsx React.DOM */ | ||
var React = require('react'); | ||
var Menu = require('rc-menu'); | ||
var SubMenu = Menu.SubMenu; | ||
var MenuItem = Menu.Item; | ||
|
||
require('rc-menu/assets/index.css'); | ||
require('font-awesome/css/font-awesome.css'); | ||
|
||
function handleSelect(selectedKey) { | ||
console.log('selected ' + selectedKey); | ||
} | ||
|
||
function handleDeselect(selectedKey) { | ||
console.log('deselect ' + selectedKey); | ||
} | ||
|
||
var titleRight = <span>sub menu <i className="fa fa-caret-right pull-right"></i></span>; | ||
var titleRight1 = <span>sub menu 1 <i className="fa fa-caret-right pull-right"></i></span>; | ||
var titleRight2 = <span>sub menu 2 <i className="fa fa-caret-right pull-right"></i></span>; | ||
var titleRight3 = <span>sub menu 3 <i className="fa fa-caret-right pull-right"></i></span>; | ||
var container = document.getElementById('__react-content'); | ||
|
||
render(container); | ||
|
||
function render(container){ | ||
var leftMenu = ( | ||
<Menu multiple={true} onSelect={handleSelect} onDeselect={handleDeselect}> | ||
<SubMenu title={titleRight}> | ||
<MenuItem>0-1</MenuItem> | ||
<MenuItem>0-2</MenuItem> | ||
</SubMenu> | ||
<MenuItem key="10">1</MenuItem> | ||
<MenuItem key="31">outer</MenuItem> | ||
<SubMenu title={titleRight1}> | ||
<MenuItem key="31">inner inner</MenuItem> | ||
<MenuItem disabled className="rc-menu-item-divider" /> | ||
<SubMenu | ||
openOnHover={false} | ||
key="110" | ||
title={titleRight2} | ||
> | ||
<MenuItem key="231">inn</MenuItem> | ||
<SubMenu title={titleRight3}> | ||
<Menu> | ||
<MenuItem key="231">inner inner</MenuItem> | ||
<MenuItem key="242">inner inner2</MenuItem> | ||
</Menu> | ||
</SubMenu> | ||
</SubMenu> | ||
</SubMenu> | ||
<MenuItem disabled>disabled</MenuItem> | ||
<MenuItem key="2311">outer3</MenuItem> | ||
</Menu> | ||
); | ||
React.render(<div><h1>multiple selectable menu</h1><div style={{width:400}}>{leftMenu}</div></div>, container); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** @jsx React.DOM */ | ||
var React = require('react'); | ||
var Menu = require('rc-menu'); | ||
var SubMenu = Menu.SubMenu; | ||
var MenuItem = Menu.Item; | ||
|
||
require('rc-menu/assets/index.css'); | ||
require('font-awesome/css/font-awesome.css'); | ||
|
||
var children = []; | ||
for (var i = 0; i < 20; i++) { | ||
children.push(<MenuItem>{i}</MenuItem>); | ||
} | ||
var style = '.rc-menu {\ | ||
height: 200px;\ | ||
width:200px;\ | ||
overflow:auto;\ | ||
}'; | ||
React.render(<div> | ||
<h1>keyboard scrollable menu</h1> | ||
<style>{style}</style> | ||
<Menu>{children}</Menu> | ||
</div>, document.getElementById('__react-content')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** @jsx React.DOM */ | ||
var React = require('react'); | ||
var Menu = require('rc-menu'); | ||
var SubMenu = Menu.SubMenu; | ||
var MenuItem = Menu.Item; | ||
|
||
require('rc-menu/assets/index.css'); | ||
require('font-awesome/css/font-awesome.css'); | ||
|
||
function handleSelect(selectedKey) { | ||
console.log('selected ' + selectedKey); | ||
} | ||
|
||
function handleDeselect(selectedKey) { | ||
console.log('deselect ' + selectedKey); | ||
} | ||
|
||
var titleRight = <span>sub menu <i className="fa fa-caret-right pull-right"></i></span>; | ||
var titleRight1 = <span>sub menu 1 <i className="fa fa-caret-right pull-right"></i></span>; | ||
var titleRight2 = <span>sub menu 2 <i className="fa fa-caret-right pull-right"></i></span>; | ||
var titleRight3 = <span>sub menu 3 <i className="fa fa-caret-right pull-right"></i></span>; | ||
var container = document.getElementById('__react-content'); | ||
|
||
render(container); | ||
|
||
function render(container){ | ||
var leftMenu = ( | ||
<Menu onSelect={handleSelect} onDeselect={handleDeselect}> | ||
<SubMenu title={titleRight}> | ||
<MenuItem>0-1</MenuItem> | ||
<MenuItem>0-2</MenuItem> | ||
</SubMenu> | ||
<MenuItem key="10">1</MenuItem> | ||
<MenuItem key="31">outer</MenuItem> | ||
<SubMenu title={titleRight1}> | ||
<MenuItem key="31">inner inner</MenuItem> | ||
<MenuItem disabled className="rc-menu-item-divider" /> | ||
<SubMenu | ||
openOnHover={false} | ||
key="110" | ||
title={titleRight2} | ||
> | ||
<MenuItem key="231">inn</MenuItem> | ||
<SubMenu title={titleRight3}> | ||
<Menu> | ||
<MenuItem key="231">inner inner</MenuItem> | ||
<MenuItem key="242">inner inner2</MenuItem> | ||
</Menu> | ||
</SubMenu> | ||
</SubMenu> | ||
</SubMenu> | ||
<MenuItem disabled>disabled</MenuItem> | ||
<MenuItem key="2311">outer3</MenuItem> | ||
</Menu> | ||
); | ||
React.render(<div><h1>single selectable menu</h1><div style={{width:400}}>{leftMenu}</div></div>, container); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
npm run less | ||
npm run example | ||
cd ../menu-gh-pages | ||
rm -rf build/ | ||
mkdir build | ||
cp -r ../menu/build/ build | ||
git add --all | ||
git commit -am "update examples" | ||
git push origin gh-pages:gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.