Skip to content

Commit

Permalink
Fixed #6
Browse files Browse the repository at this point in the history
  • Loading branch information
andris-sevcenko committed Jul 31, 2017
1 parent 9e31b2e commit 588a2ec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
## Unreleased

### Fixed
- Fixed a bug where cache duration information was not being saved for Volumes. ([#6](https://github.com/craftcms/aws-s3/issues/6))
- Fixed a bug where it was not possible to list buckets when using newer AWS SDK versions.

## 1.0.4 - 2017-07-07
Expand Down
1 change: 0 additions & 1 deletion src/Volume.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Aws\S3\S3Client;
use Aws\Sts\StsClient;
use Craft;
use craft\errors\VolumeException;
use craft\helpers\Assets;
use craft\helpers\DateTimeHelper;
use craft\helpers\StringHelper;
Expand Down
16 changes: 15 additions & 1 deletion src/resources/js/editVolume.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,18 @@ $s3BucketSelect.change(function()

$('.volume-url').val($selectedOption.data('url-prefix'));
$s3Region.val($selectedOption.data('region'));
});
});

var s3ChangeExpiryValue = function ()
{
var parent = $(this).parents('.field'),
amount = parent.find('.s3-expires-amount').val(),
period = parent.find('.s3-expires-period select').val();

var combinedValue = (parseInt(amount, 10) === 0 || period.length === 0) ? '' : amount + ' ' + period;

parent.find('[type=hidden]').val(combinedValue);
};

$('.s3-expires-amount').keyup(s3ChangeExpiryValue).change(s3ChangeExpiryValue);
$('.s3-expires-period select').change(s3ChangeExpiryValue);
4 changes: 2 additions & 2 deletions src/templates/volumeSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@
id: 'expiresAmount',
value: expires[0],
size: 2,
class: 'expires-amount'
class: 's3-expires-amount'
}) }}
</div>
{{ forms.select({
id: 'expiresPeriod',
options: periods,
value: expires[1],
class: 'expires-period'
class: 's3-expires-period'
}) }}
</div>
{{ forms.hidden({
Expand Down

0 comments on commit 588a2ec

Please sign in to comment.