Skip to content

Commit

Permalink
zoom validation bozdoz#189 Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe13 committed Dec 27, 2022
1 parent 8ddfb0b commit 2690b7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion class.plugin-option.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class="full-width"
?>
<input
class="full-width"
step="any"
min="<?php echo isset($this->min) ? $this->min : ""; ?>"
max="<?php echo isset($this->max) ? $this->max : ""; ?>"
step="<?php echo isset($this->step) ? $this->step : "any"; ?>"
name="<?php echo $name; ?>"
type="<?php echo $this->type; ?>"
id="<?php echo $name; ?>"
Expand Down
9 changes: 9 additions & 0 deletions class.plugin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ private function __construct()
'display_name'=>__('Default Zoom', 'leaflet-map'),
'default'=>'12',
'type' => 'number',
'min' => 0,
'max' => 20,
'step' => 1,
'helptext' => sprintf(
'%1$s %2$s <br /> <code>[leaflet-map zoom="5"]</code>',
__('Default zoom for maps.', 'leaflet-map'),
Expand Down Expand Up @@ -171,6 +174,9 @@ private function __construct()
'display_name'=>__('Default Min Zoom', 'leaflet-map'),
'default' => '0',
'type' => 'number',
'min' => 0,
'max' => 20,
'step' => 1,
'helptext' => sprintf(
'%1$s %2$s <br /> <code>[leaflet-map min_zoom="1"]</code>',
__('Restrict the viewer from zooming in past the minimum zoom. Can set per map in shortcode or adjust for all maps here.', 'leaflet-map'),
Expand All @@ -181,6 +187,9 @@ private function __construct()
'display_name'=>__('Default Max Zoom', 'leaflet-map'),
'default' => '19',
'type' => 'number',
'min' => 0,
'max' => 20,
'step' => 1,
'helptext' => sprintf(
'%1$s %2%s <br /> <code>%3$s</code>',
__('Restrict the viewer from zooming out past the maximum zoom. Can set per map in shortcode or adjust for all maps here', 'leaflet-map'),
Expand Down

0 comments on commit 2690b7c

Please sign in to comment.