Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit aea9cd6

Browse files
committed
Fix an error caused by the dynamic presets API. Closes #10
1 parent 6bbcef2 commit aea9cd6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/presets.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ class Presets {
1818

1919
protected static $presets = [];
2020
protected static $saved = [];
21+
protected static $initial = null;
2122

2223
public static function save($name) {
23-
if(array_key_exists('initial', static::$saved)) {
24-
throw new Exception('Initial presets are saved on initialization and cannot not be overridden at a later point.');
25-
}
2624
static::$saved[$name] = static::$presets;
2725
}
2826

@@ -60,10 +58,10 @@ public static function set($name, $sizes = null) {
6058

6159
public static function init($presets) {
6260
static::set($presets);
63-
static::save('initial');
61+
static::$initial = $presets;
6462
}
6563

6664
public static function reset() {
67-
static::load('initial');
65+
static::$presets = static::$initial;
6866
}
6967
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A flexible, responsive image component for Kirby CMS, featuring lazy loading, fancy placeholders and more.",
44
"author": "Fabian Michael <[email protected]>",
55
"license": "SEE LICENSE IN license.md",
6-
"version": "1.0.0",
6+
"version": "1.0.1",
77
"type": "kirby-plugin",
88
"repository": {
99
"type": "git",

0 commit comments

Comments
 (0)