Skip to content

Commit

Permalink
Fix PHP notices - Issue 1124 (#11)
Browse files Browse the repository at this point in the history
* add default fit_to_aspect_ratio setting

* fix Form notices from settings without defaults

* Remove duplicate form item configuration and incorrect label

* add missing config settings

* revert isset checks on added default settings
  • Loading branch information
seth-shaw-unlv authored and whikloj committed May 23, 2019
1 parent d4d950c commit 03610ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
11 changes: 11 additions & 0 deletions config/install/openseadragon.settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
default_options:
fit_to_aspect_ratio : FALSE
tabIndex : 0
debugMode : FALSE
debugGridColor : '#437AB2'
Expand All @@ -8,7 +9,11 @@ default_options:
immediateRender : FALSE
defaultZoomLevel : 0
opacity : 1
compositeOperation: ''
placeholderFillStyle: ''
degrees : 0
minZoomLevel: ''
maxZoomLevel: ''
homeFillsViewer : FALSE
panHorizontal : TRUE
panVertical : TRUE
Expand Down Expand Up @@ -73,6 +78,10 @@ default_options:
navigatorPosition : 'TOP_RIGHT'
navigatorSizeRatio : 0.2
navigatorMaintainSizeRatio : FALSE
navigatorTop: ''
navigatorLeft: ''
navigatorHeight: ''
navigatorWidth: ''
navigatorAutoResize : TRUE
navigatorAutoFade : TRUE
navigatorRotate : TRUE
Expand All @@ -98,6 +107,8 @@ default_options:
preserveOverlays : FALSE
showReferenceStrip : FALSE
referenceStripScroll : 'horizontal'
referenceStripHeight: ''
referenceStripWidth: ''
referenceStripPosition : 'BOTTOM_LEFT'
referenceStripSizeRatio : 0.2
collectionMode : FALSE
Expand Down
14 changes: 3 additions & 11 deletions src/Form/OpenSeadragonSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#title' => t('Navigator Height'),
'#size' => 10,
'#element_validate' => [[$this, 'elementValidateNumber']],
'#default_value' => $settings['navigatorHeight'],
'#default_value' => $settings['navigatorHeight'] ,
'#description' => t('Specifies the size of the navigator minimap (see Navigator Position). If specified, Navigator Size Ratio and Navigator Maintain Size Ratio are ignored.'),
],
'navigatorWidth' => [
Expand Down Expand Up @@ -764,25 +764,17 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#default_value' => $settings['controlsFadeLength'],
'#description' => t('The number of milliseconds to animate the controls fading out.'),
],
'controlsFadeDelay' => [
'#type' => 'textfield',
'#title' => t('Controls Fade Delay'),
'#size' => 10,
'#element_validate' => [[$this, 'elementValidateNumber']],
'#default_value' => $settings['controlsFadeDelay'],
'#description' => t('The number of milliseconds to wait once the user has stopped interacting with the interface before begining to fade the controls. Assumes showNavigationControl and autoHideControls are both true.'),
],
'maxImageCacheCount' => [
'#type' => 'textfield',
'#title' => t('Controls Fade Delay'),
'#title' => t('Max Image Cache Count'),
'#size' => 10,
'#element_validate' => [[$this, 'elementValidateNumber']],
'#default_value' => $settings['maxImageCacheCount'],
'#description' => t('The max number of images we should keep in memory (per drawer).'),
],
'timeout' => [
'#type' => 'textfield',
'#title' => t('timeout'),
'#title' => t('Timeout'),
'#size' => 10,
'#element_validate' => [[$this, 'elementValidateNumber']],
'#default_value' => $settings['timeout'],
Expand Down

0 comments on commit 03610ed

Please sign in to comment.