Fixed timelapse postroll settings

* Changing Timelapse post roll activates save button
* Timelapse post roll is loaded properly from config
(cherry picked from commit e1d7573)
This commit is contained in:
Gina Häußge 2015-02-24 11:08:23 +01:00
parent 543b8df48b
commit a6e5ea268b
2 changed files with 13 additions and 2 deletions

View file

@ -124,6 +124,8 @@
* Do not deliver the API key on settings API unless user has admin rights
* Don't hiccup on slic3r filament_diameter comments in GCODE generated for multi extruder setups
* Color code successful or failed print results directly in file list, not just after a reload
* Changing Timelapse post roll activates save button
* Timelapse post roll is loaded properly from config
([Commits](https://github.com/foosel/OctoPrint/compare/master...devel))

View file

@ -39,6 +39,9 @@ $(function() {
self.timelapseTimedInterval.subscribe(function(newValue) {
self.isDirty(true);
});
self.timelapsePostRoll.subscribe(function(newValue) {
self.isDirty(true);
});
// initialize list helper
self.listHelper = new ItemListHelper(
@ -87,10 +90,16 @@ $(function() {
self.timelapseType(config.type);
self.listHelper.updateItems(response.files);
if (config.type == "timed" && response.config.interval) {
self.timelapseTimedInterval(response.config.interval);
if (config.type == "timed") {
if (response.config.interval != undefined && response.config.interval > 0) {
self.timelapseTimedInterval(response.config.interval);
}
if (response.config.postRoll != undefined && response.config.postRoll >= 0) {
self.timelapsePostRoll(response.config.postRoll);
}
} else {
self.timelapseTimedInterval(undefined);
self.timelapsePostRoll(undefined);
}
self.persist(false);