From bd5d41aa88073fba2f2e70e933e9071576a46594 Mon Sep 17 00:00:00 2001 From: William Petit Date: Sun, 30 Aug 2015 21:29:19 +0200 Subject: [PATCH] Base chargement des icons des applications --- css/style.css | 15 +- img/hourglass.svg | 1 + js/components/app-list.jsx | 14 ++ js/components/desktop-app-item.jsx | 32 ++-- js/components/desktop-app-list.jsx | 5 + js/components/mixins/lazy-load.js | 55 +++++++ js/util/desktop-apps.js | 230 ++++++++++++++++++++++++----- js/util/system.js | 53 +++++++ package.json | 5 +- test/desktop.js | 35 +++++ 10 files changed, 393 insertions(+), 52 deletions(-) create mode 100644 img/hourglass.svg create mode 100644 js/components/mixins/lazy-load.js create mode 100644 test/desktop.js diff --git a/css/style.css b/css/style.css index fe28299..3de453b 100644 --- a/css/style.css +++ b/css/style.css @@ -48,7 +48,6 @@ html, body { } .launcher ul.apps-list { - display: block; margin: 0; padding: 0; display: flex; @@ -105,17 +104,27 @@ html, body { /* Edit View */ +.edit { + display: flex; + width: 100%; + height: 100%; + flex-direction: column; + align-items: flex-start; +} + .edit ul.desktop-apps { list-style: none; padding: 0; + overflow-y: auto; } .edit li.desktop-app { - height: 30px; + } .edit img.desktop-app-icon { - height: 30px; + height: 50px; + width: 50px; display: inline-block; vertical-align: middle; margin-right: 10px; diff --git a/img/hourglass.svg b/img/hourglass.svg new file mode 100644 index 0000000..5a3e56c --- /dev/null +++ b/img/hourglass.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/js/components/app-list.jsx b/js/components/app-list.jsx index 15b81c2..4c13fed 100644 --- a/js/components/app-list.jsx +++ b/js/components/app-list.jsx @@ -4,24 +4,38 @@ var AppItem = require('./app-item.jsx'); module.exports = React.createClass({ propTypes: { + + // The app items to display in the list items: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, + + // the parent item path parentPath: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.arrayOf(React.PropTypes.number) ]).isRequired, + + // Item click handler onItemClick: React.PropTypes.func.isRequired, + }, render: function() { var parentPath = this.props.parentPath; + + // For each items, we create an AppItem component var items = (this.props.items).map(function(item, i) { + + // The item path identifier var path = parentPath+'.'+i; + return ( ); + }.bind(this)); + // Create the apps list return (