Skip to content
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

Zooming should not change amount of view presets in Scheduler PresetStore #216

Closed
pmiklashevych opened this issue Jan 22, 2020 · 3 comments
Assignees
Labels
bug Something isn't working not reproducible

Comments

@pmiklashevych
Copy link

pmiklashevych commented Jan 22, 2020

Forum: https://www.bryntum.com/forum/viewtopic.php?f=44&t=11732&p=68656#p68656

  1. Go to http://lh/bryntum-suite/scheduler/examples/basic/
  2. Run in console:
scheduler.presets.removeAll();

scheduler.presets.add([
    {
        base : 'hourAndDay',
        id   : 'MyHourAndDay'
    },
    {
        base : 'weekAndMonth',
        id   : 'MyWeekAndMonth'
    }
]);

scheduler.viewPreset = 'MyHourAndDay';
  1. scheduler.presets.count // 2
  2. Zoom In/Out
  3. scheduler.presets.count // 3
@ExtAnimal
Copy link

The problem is in here in TimelineZoomable.zoomToLevel

// If we revert back to the original settings, and we had an original span
// then revert back to that span.
if (config.startDate && config.endDate && config.viewPreset && newPreset.equals(me.normalizePreset(config.viewPreset))) {
    span = {
        startDate : config.startDate,
        endDate   : config.endDate
    };
}
else {
    span = me.calculateOptimalDateRange(centerDate, panelSize, newPreset);
}

It attempts to see if the preset being set is the same as the one originally configured, and if so, using the same startDate and endDate as originally configured.

I think we agreed to remove that and always use span = me.calculateOptimalDateRange(centerDate, panelSize, newPreset);

The actual additional preset was because normalizePreset adds the resulting ViewPreset that it converts to into the Scheduler's presets store. Maybe that needs an extra boolean flag to say skipAddToPresets.

@pmiklashevych pmiklashevych added the bug Something isn't working label Jan 22, 2020
@isglass isglass added this to the Scheduler 3.0.2 milestone Jan 22, 2020
@matsbryntse matsbryntse modified the milestones: Scheduler 3.0.2, Scheduler 3.0.3 Jan 29, 2020
@matsbryntse matsbryntse modified the milestones: Scheduler 3.0.3, Scheduler 3.0.4 Feb 12, 2020
@matsbryntse matsbryntse modified the milestones: Scheduler 3.0.4, Scheduler 3.1.0 Feb 21, 2020
@matsbryntse matsbryntse modified the milestones: Scheduler 3.1.0, Scheduler 3.1.1 Mar 6, 2020
@canonic-epicure
Copy link

Screencast.2023-07-28.16.18.36.mp4

@canonic-epicure
Copy link

Not reproducible anymore

@canonic-epicure canonic-epicure closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2023
@canonic-epicure canonic-epicure self-assigned this Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working not reproducible
Projects
None yet
Development

No branches or pull requests

5 participants