-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from blackcandy-org/playing-behavior
Add new playing begin with behavior on songs in album or playlist
- Loading branch information
Showing
29 changed files
with
249 additions
and
103 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
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 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 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,34 @@ | ||
import { Controller } from '@hotwired/stimulus' | ||
import { installEventHandler } from './mixins/event_handler' | ||
import { isNativeApp } from '../helper' | ||
|
||
export default class extends Controller { | ||
static get shouldLoad () { | ||
return isNativeApp() | ||
} | ||
|
||
static values = { | ||
id: Number | ||
} | ||
|
||
initialize () { | ||
installEventHandler(this) | ||
} | ||
|
||
connect () { | ||
this.handleEvent('click', { | ||
on: this.element, | ||
with: this.playBeginWith, | ||
delegation: true | ||
}) | ||
} | ||
|
||
play () { | ||
App.nativeBridge.playAlbum(this.idValue) | ||
} | ||
|
||
playBeginWith = (event) => { | ||
const { songId } = event.target.closest('[data-song-id]').dataset | ||
App.nativeBridge.playAlbumBeginWith(this.idValue, songId) | ||
} | ||
} |
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 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 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 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 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,34 @@ | ||
import { Controller } from '@hotwired/stimulus' | ||
import { installEventHandler } from './mixins/event_handler' | ||
import { isNativeApp } from '../helper' | ||
|
||
export default class extends Controller { | ||
static get shouldLoad () { | ||
return isNativeApp() | ||
} | ||
|
||
static values = { | ||
id: Number | ||
} | ||
|
||
initialize () { | ||
installEventHandler(this) | ||
} | ||
|
||
connect () { | ||
this.handleEvent('click', { | ||
on: this.element, | ||
with: this.playBeginWith, | ||
delegation: true | ||
}) | ||
} | ||
|
||
play () { | ||
App.nativeBridge.playPlaylist(this.idValue) | ||
} | ||
|
||
playBeginWith = (event) => { | ||
const { songId } = event.target.closest('[data-song-id]').dataset | ||
App.nativeBridge.playPlaylistBeginWith(this.idValue, songId) | ||
} | ||
} |
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
File renamed without changes.
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.