From 540bafe6fe1662c7794c068ca7ea6e2245d019b7 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Sat, 8 Nov 2014 14:21:55 -0600 Subject: [PATCH] Doc Site - moved dropdown menu to its own page --- docs/src/app/app-routes.jsx | 3 ++ .../pages/components/drop-down-menu.jsx | 48 +++++++++++++++++++ .../app/components/pages/components/menus.jsx | 33 ------------- 3 files changed, 51 insertions(+), 33 deletions(-) create mode 100644 docs/src/app/components/pages/components/drop-down-menu.jsx diff --git a/docs/src/app/app-routes.jsx b/docs/src/app/app-routes.jsx index 0b15692fc2e041..2688a8bc836739 100644 --- a/docs/src/app/app-routes.jsx +++ b/docs/src/app/app-routes.jsx @@ -19,6 +19,7 @@ var React = require('react'), Buttons = require('./components/pages/components/buttons.jsx'), Dialog = require('./components/pages/components/dialog.jsx'), + DropDownMenu = require('./components/pages/components/drop-down-menu.jsx'), Icons = require('./components/pages/components/icons.jsx'), Inputs = require('./components/pages/components/inputs.jsx'), LeftNav = require('./components/pages/components/left-nav.jsx'), @@ -35,6 +36,7 @@ var React = require('react'), componentsMenuItems = [ { route: 'buttons', text: 'Buttons'}, { route: 'dialog', text: 'Dialog'}, + { route: 'dropdown-menu', text: 'Dropdown Menu'}, { route: 'icons', text: 'Icons'}, { route: 'inputs', text: 'Inputs'}, { route: 'menus', text: 'Menus'}, @@ -59,6 +61,7 @@ var AppRoutes = ( + diff --git a/docs/src/app/components/pages/components/drop-down-menu.jsx b/docs/src/app/components/pages/components/drop-down-menu.jsx new file mode 100644 index 00000000000000..2f4575bf57d40c --- /dev/null +++ b/docs/src/app/components/pages/components/drop-down-menu.jsx @@ -0,0 +1,48 @@ +/** + * @jsx React.DOM + */ + +var React = require('react'), + mui = require('mui'), + CodeExample = require('../../code-example/code-example.jsx'), + + menuItems = [ + { payload: '1', text: 'Never' }, + { payload: '2', text: 'Every Night' }, + { payload: '3', text: 'Weeknights' }, + { payload: '4', text: 'Weekends' }, + { payload: '5', text: 'Weekly' }, + ]; + +var MenusPage = React.createClass({ + + render: function() { + return ( +
+

Drop Down Menu

+ {this._getDropDownMenuExample()} +
+ ); + }, + + _getDropDownMenuExample: function() { + var code = + "var menuItems = [\n" + + " { payload: '1', text: 'Never' },\n" + + " { payload: '2', text: 'Every Night' },\n" + + " { payload: '3', text: 'Weeknights' },\n" + + " { payload: '4', text: 'Weekends' },\n" + + " { payload: '5', text: 'Weekly' },\n" + + "];\n\n" + + ""; + + return ( + + + + ); + } + +}); + +module.exports = MenusPage; \ No newline at end of file diff --git a/docs/src/app/components/pages/components/menus.jsx b/docs/src/app/components/pages/components/menus.jsx index 4382be67b06245..c3f22973f7e7b5 100644 --- a/docs/src/app/components/pages/components/menus.jsx +++ b/docs/src/app/components/pages/components/menus.jsx @@ -6,14 +6,6 @@ var React = require('react'), mui = require('mui'), CodeExample = require('../../code-example/code-example.jsx'), - menuItems = [ - { payload: '1', text: 'Never' }, - { payload: '2', text: 'Every Night' }, - { payload: '3', text: 'Weeknights' }, - { payload: '4', text: 'Weekends' }, - { payload: '5', text: 'Weekly' }, - ], - labelMenuItems = [ { payload: '1', text: 'ID', data: '1234567890', icon: 'home' }, { payload: '2', text: 'Type', data: 'Announcement', icon: 'home' }, @@ -72,9 +64,6 @@ var MenusPage = React.createClass({ render: function() { return (
-

Drop Down Menu

- {this._getDropDownMenuExample()} -

Label Menu

{this._getLabelMenuExample()} @@ -93,24 +82,6 @@ var MenusPage = React.createClass({ ); }, - _getDropDownMenuExample: function() { - var code = - "var menuItems = [\n" + - " { payload: '1', text: 'Never' },\n" + - " { payload: '2', text: 'Every Night' },\n" + - " { payload: '3', text: 'Weeknights' },\n" + - " { payload: '4', text: 'Weekends' },\n" + - " { payload: '5', text: 'Weekly' },\n" + - "];\n\n" + - ""; - - return ( - - - - ); - }, - _getLabelMenuExample: function() { var code = "var labelMenuItems = [\n" + @@ -223,10 +194,6 @@ var MenusPage = React.createClass({ ); }, - _onDropDownMenuChange: function(e, key, menuItem) { - console.log('Menu Clicked: ', menuItem); - }, - _onFilterMenuToggle: function(e, key, menuItem, toggled) { console.log('Filter Menu Toggled: ', key, menuItem, toggled) },