-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments Added #49
Open
saurabhk9919
wants to merge
9
commits into
Gauravdarkslayer:main
Choose a base branch
from
saurabhk9919:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Comments Added #49
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e3e70cb
comments added
saurabhk9919 d892516
Merge branch 'main' of https://github.com/Gauravdarkslayer/ngx-stories
saurabhk9919 4796704
conflicts solved
saurabhk9919 a88edea
Merge branch 'Gauravdarkslayer:main' into main
saurabhk9919 60bba7c
done changes as instucted
saurabhk9919 52a4311
done changes as instucted
saurabhk9919 333c6ff
made the changes
saurabhk9919 a53fd8f
Merge remote-tracking branch 'upstream/main'
saurabhk9919 7d7023f
modified
saurabhk9919 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -11,8 +11,6 @@ export class NgxStoriesService { | |
startProgress(interval: number, callback: () => void): any { | ||
return setInterval(() => callback(), interval); | ||
} | ||
|
||
// Clears the progress interval | ||
clearProgress(intervalId: any): void { | ||
clearInterval(intervalId); | ||
} | ||
|
@@ -23,40 +21,34 @@ export class NgxStoriesService { | |
onStoryGroupChange: (storyGroupIndex: number) => void): { storyGroupIndex: number, storyIndex: number } { | ||
let stories = storyGroups[currentStoryGroupIndex]?.stories; | ||
if (currentStoryIndex === stories.length - 1) { | ||
// Move to the next storyGroup if the current story index is the last | ||
currentStoryGroupIndex = (currentStoryGroupIndex + 1) % storyGroups.length; | ||
currentStoryIndex = 0; | ||
onStoryGroupChange(currentStoryGroupIndex); | ||
} else { | ||
// Otherwise, just move to the next story within the same storyGroup | ||
currentStoryIndex++; | ||
} | ||
return { storyGroupIndex: currentStoryGroupIndex, storyIndex: currentStoryIndex }; | ||
} | ||
|
||
prevStory(storyGroups: StoryGroup[], | ||
// Array of story groups | ||
prevStory(storyGroups: StoryGroup[], | ||
currentStoryGroupIndex: number, | ||
currentStoryIndex: number, | ||
onStoryGroupChange: (storyGroupIndex: number) => void): { storyGroupIndex: number, storyIndex: number } { | ||
let stories = storyGroups[currentStoryGroupIndex]?.stories; | ||
if (currentStoryIndex === 0) { | ||
// Move to the previous storyGroup if the current story index is 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please retain existing comments |
||
if (currentStoryGroupIndex > 0) { | ||
currentStoryGroupIndex--; | ||
stories = storyGroups[currentStoryGroupIndex]?.stories; | ||
currentStoryIndex = stories.length - 1; | ||
onStoryGroupChange(currentStoryGroupIndex); | ||
} | ||
} else { | ||
// Otherwise, just move to the previous story within the same storyGroup | ||
currentStoryIndex--; | ||
} | ||
return { storyGroupIndex: currentStoryGroupIndex, storyIndex: currentStoryIndex }; | ||
} | ||
|
||
setOptions(options: NgxStoriesOptions, storyContainers: QueryList<ElementRef>): void { | ||
// Set the options for the service | ||
// Set the width and height of the story container | ||
// Set the options for the service | ||
setOptions(options: NgxStoriesOptions, storyContainers: QueryList<ElementRef>): void { | ||
storyContainers?.forEach(storyContainer => { | ||
storyContainer.nativeElement.style.width = options.width + 'px'; | ||
storyContainer.nativeElement.style.height = options.height + 'px'; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep existing comments