A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Let playlist drag n drop scroll on desktop but not touch devices

+36 -11
+9 -1
src/Applications/UI.elm
··· 121 121 , isDragging : Bool 122 122 , isLoading : Bool 123 123 , isOnline : Bool 124 + , isTouchDevice : Bool 124 125 , isUpgrading : Bool 125 126 , navKey : Nav.Key 126 127 , notifications : UI.Notifications.Model ··· 178 179 , isDragging = False 179 180 , isLoading = True 180 181 , isOnline = flags.isOnline 182 + , isTouchDevice = False 181 183 , isUpgrading = flags.upgrade 182 184 , navKey = key 183 185 , notifications = [] ··· 254 256 | ShowNotification (Notification Reply) 255 257 | SetCurrentTime Time.Posix 256 258 | SetIsOnline Bool 259 + | SetIsTouchDevice Bool 257 260 | StoppedDragging 258 261 | ToggleLoadingScreen Switch 259 262 ----------------------------------------- ··· 510 513 return 511 514 ) 512 515 { model | isOnline = True } 516 + 517 + SetIsTouchDevice bool -> 518 + return { model | isTouchDevice = bool } 513 519 514 520 ShowNotification notification -> 515 521 showNotification notification model ··· 1871 1877 ) 1872 1878 1873 1879 -- 1874 - , Ports.downloadTracksFinished (always DownloadTracksFinished) 1880 + , Ports.downloadTracksFinished (\_ -> DownloadTracksFinished) 1881 + , Ports.indicateTouchDevice (\_ -> SetIsTouchDevice True) 1875 1882 , Ports.preferredColorSchemaChanged PreferredColorSchemaChanged 1876 1883 , Ports.showErrorNotification (Notifications.error >> ShowNotification) 1877 1884 , Ports.setAverageBackgroundColor (Backdrop.BackgroundColor >> BackdropMsg) ··· 2129 2136 , bgColor = model.backdrop.bgColor 2130 2137 , darkMode = model.darkMode 2131 2138 , isOnIndexPage = model.page == Page.Index 2139 + , isTouchDevice = model.isTouchDevice 2132 2140 , sourceIdsBeingProcessed = List.map Tuple.first model.sources.isProcessing 2133 2141 , viewport = model.viewport 2134 2142 }
+3
src/Applications/UI/Ports.elm
··· 49 49 port downloadTracksFinished : (() -> msg) -> Sub msg 50 50 51 51 52 + port indicateTouchDevice : (() -> msg) -> Sub msg 53 + 54 + 52 55 port fromAlien : (Alien.Event -> msg) -> Sub msg 53 56 54 57
+2
src/Applications/UI/Tracks.elm
··· 645 645 , bgColor : Maybe Color 646 646 , darkMode : Bool 647 647 , isOnIndexPage : Bool 648 + , isTouchDevice : Bool 648 649 , sourceIdsBeingProcessed : List String 649 650 , viewport : Viewport 650 651 } ··· 985 986 { bgColor = deps.bgColor 986 987 , darkMode = deps.darkMode 987 988 , height = deps.viewport.height 989 + , isTouchDevice = deps.isTouchDevice 988 990 , isVisible = deps.isOnIndexPage 989 991 , showAlbum = deps.viewport.width >= 720 990 992 }
+11 -10
src/Applications/UI/Tracks/Scene/List.elm
··· 100 100 { bgColor : Maybe Color 101 101 , darkMode : Bool 102 102 , height : Float 103 + , isTouchDevice : Bool 103 104 , isVisible : Bool 104 105 , showAlbum : Bool 105 106 } ··· 131 132 -- 132 133 , C.md__text_almost_sm 133 134 134 - -- TODO 135 - -- , case maybeDnD of 136 - -- Just dnd -> 137 - -- if DnD.isDragging dnd then 138 - -- C.overflow_y_hidden 139 135 -- 140 - -- else 141 - -- C.overflow_y_auto 142 - -- 143 - -- Nothing -> 144 - -- C.overflow_y_auto 136 + , case maybeDnD of 137 + Just dnd -> 138 + if deps.isTouchDevice && DnD.isDragging dnd then 139 + C.overflow_y_hidden 140 + 141 + else 142 + C.overflow_y_auto 143 + 144 + Nothing -> 145 + C.overflow_y_auto 145 146 ] 146 147 [ -- Shadow 147 148 ---------
+11
src/Javascript/index.js
··· 522 522 523 523 524 524 525 + // Touch Device 526 + // ------------ 527 + 528 + window.addEventListener("touchstart", function onFirstTouch() { 529 + console.log("TOUCH") 530 + app.ports.indicateTouchDevice.send(null) 531 + window.removeEventListener("touchstart", onFirstTouch, false) 532 + }, false) 533 + 534 + 535 + 525 536 // Upgrade 526 537 // ------- 527 538