From 086f52761ae34737aa932f583ac2e33ce24d5941 Mon Sep 17 00:00:00 2001 From: An Phan Date: Sat, 14 Jan 2017 21:09:38 +0800 Subject: [PATCH 1/2] Implemented virtual scroll for desktop --- composer.lock | 54 ++- package.json | 2 + .../main-wrapper/main-content/index.vue | 2 +- .../assets/js/components/shared/song-item.vue | 61 ++- .../js/components/shared/song-list-header.vue | 44 -- .../shared/song-list-virtual-scroller.vue | 150 ------- .../assets/js/components/shared/song-list.vue | 390 +++++++++--------- resources/assets/js/main.js | 3 + resources/assets/js/services/playback.js | 8 +- resources/assets/js/services/youtube.js | 6 +- yarn.lock | 345 ++++++++++------ 11 files changed, 509 insertions(+), 556 deletions(-) delete mode 100644 resources/assets/js/components/shared/song-list-header.vue delete mode 100644 resources/assets/js/components/shared/song-list-virtual-scroller.vue diff --git a/composer.lock b/composer.lock index 6ab91e75..4e92c439 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f79521ac890ccb2cd8adb3e05124f2ca", - "content-hash": "2df0199a58da73ea5f5bdd18b128bd78", + "hash": "2765714b2784ee8330870d671e24d978", + "content-hash": "257f7945ff8c69813d8e4a1afda2a884", "packages": [ { "name": "aws/aws-sdk-php", @@ -1493,6 +1493,56 @@ ], "time": "2015-01-28 21:50:33" }, + { + "name": "predis/predis", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/nrk/predis.git", + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1", + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "suggest": { + "ext-curl": "Allows access to Webdis when paired with phpiredis", + "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" + }, + "type": "library", + "autoload": { + "psr-4": { + "Predis\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniele Alessandri", + "email": "suppakilla@gmail.com", + "homepage": "http://clorophilla.net" + } + ], + "description": "Flexible and feature-complete Redis client for PHP and HHVM", + "homepage": "http://github.com/nrk/predis", + "keywords": [ + "nosql", + "predis", + "redis" + ], + "time": "2016-06-16 16:22:20" + }, { "name": "psr/http-message", "version": "1.0.1", diff --git a/package.json b/package.json index 34d79be8..277be85e 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "select": "^1.0.6", "slugify": "^1.0.2", "vue": "^2.0.1", + "vue-virtual-scroller": "^0.5.0", + "vuequery": "^1.0.0", "youtube-player": "^3.0.4" }, "devDependencies": { diff --git a/resources/assets/js/components/main-wrapper/main-content/index.vue b/resources/assets/js/components/main-wrapper/main-content/index.vue index 1e8ee08d..9b02bc80 100644 --- a/resources/assets/js/components/main-wrapper/main-content/index.vue +++ b/resources/assets/js/components/main-wrapper/main-content/index.vue @@ -147,7 +147,7 @@ export default { bottom: -20px; filter: blur(20px); opacity: .07; - z-index: 0; + z-index: 2; overflow: hidden; background-size: cover; background-position: center; diff --git a/resources/assets/js/components/shared/song-item.vue b/resources/assets/js/components/shared/song-item.vue index aab3b14d..0eb30024 100644 --- a/resources/assets/js/components/shared/song-item.vue +++ b/resources/assets/js/components/shared/song-item.vue @@ -3,14 +3,14 @@ class="song-item" draggable="true" :data-song-id="song.id" - @click="clicked($event)" + @click="clicked" @dblclick.prevent="playRightAwayyyyyyy" - @dragstart="$parent.dragStart(song.id, $event)" - @dragleave="$parent.removeDroppableState($event)" - @dragover.prevent="$parent.allowDrop(song.id, $event)" - @drop.stop.prevent="$parent.handleDrop(song.id, $event)" - @contextmenu.prevent="$parent.openContextMenu(song.id, $event)" - :class="{ selected: selected, playing: playing }" + @dragstart="dragStart" + @dragleave="removeDroppableState" + @dragover.prevent="allowDrop" + @drop.stop.prevent="handleDrop" + @contextmenu.prevent="openContextMenu" + :class="{ selected: item.selected, playing: playing }" > {{ song.track || '' }} {{ song.title }} @@ -27,22 +27,36 @@ diff --git a/resources/assets/js/components/shared/song-list-virtual-scroller.vue b/resources/assets/js/components/shared/song-list-virtual-scroller.vue deleted file mode 100644 index 4b8713ec..00000000 --- a/resources/assets/js/components/shared/song-list-virtual-scroller.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - - diff --git a/resources/assets/js/components/shared/song-list.vue b/resources/assets/js/components/shared/song-list.vue index 43de0827..3d486727 100644 --- a/resources/assets/js/components/shared/song-list.vue +++ b/resources/assets/js/components/shared/song-list.vue @@ -2,81 +2,79 @@
- +
- - - - - - - - -
# - - + # + + Title - - + Title + + Artist + Artist Album + Album Time - - + Time + +
+ + -