Skip to content

Commit

Permalink
Fixed #3035
Browse files Browse the repository at this point in the history
  • Loading branch information
andris-sevcenko committed Jul 12, 2018
1 parent fb81607 commit 78c9dea
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Fixed
- Fixed a bug where you could get an error message sending emails in some environments that did not have the [intl](https://secure.php.net/manual/en/book.intl.php) extension installed.
- Fixed an exception that was thrown if the `securityKey` config setting was changed and Craft was set to use either the SMTP or Gmail mailer transport type. ([#3083](https://github.com/craftcms/cms/issues/3083))
- Fixed a bug where Asset view was not being refreshed in some cases after using Image Editor. ([#3035](https://github.com/craftcms/cms/issues/3035))

## 3.0.15 - 2018-07-09

Expand Down
26 changes: 21 additions & 5 deletions src/web/assets/cp/dist/js/Craft.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! - 2018-07-11 */
/*! - 2018-07-12 */
(function($){

/** global: Craft */
Expand Down Expand Up @@ -1673,6 +1673,7 @@ Craft.BaseElementEditor = Garnish.Base.extend(
siteId: null,
attributes: null,
params: null,
elementIndex: null,

onShowHud: $.noop,
onHideHud: $.noop,
Expand Down Expand Up @@ -3669,7 +3670,9 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
},

createElementEditor: function($element) {
Craft.createElementEditor(this.elementIndex.elementType, $element);
Craft.createElementEditor(this.elementIndex.elementType, $element, {
elementIndex: this.elementIndex
});
},

disable: function() {
Expand Down Expand Up @@ -4737,6 +4740,8 @@ Craft.AdminTable = Garnish.Base.extend(
*/
Craft.AssetEditor = Craft.BaseElementEditor.extend(
{
reloadIndex: false,

updateForm: function(response) {
this.base(response);

Expand All @@ -4753,11 +4758,21 @@ Craft.AssetEditor = Craft.BaseElementEditor.extend(
showImageEditor: function()
{
new Craft.AssetImageEditor(this.$element.data('id'), {
onSave: $.proxy(this, 'reloadForm'),
onSave: function () {
this.reloadIndex = true;
this.reloadForm();
}.bind(this),
allowDegreeFractions: Craft.isImagick
});
}
},

onHideHud: function () {
if (this.reloadIndex && this.settings.elementIndex) {
this.settings.elementIndex.updateElements();
}

this.base();
}
});

// Register it!
Expand Down Expand Up @@ -18078,7 +18093,8 @@ Craft.TableElementIndexView = Craft.BaseElementIndexView.extend(
if (response.tableAttributes) {
this._updateTableAttributes($element, response.tableAttributes);
}
}, this)
}, this),
elementIndex: this.elementIndex
});
},

Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/js/Craft.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/js/Craft.min.js.map

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions src/web/assets/cp/src/js/AssetEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
Craft.AssetEditor = Craft.BaseElementEditor.extend(
{
reloadIndex: false,

updateForm: function(response) {
this.base(response);

Expand All @@ -21,11 +23,21 @@ Craft.AssetEditor = Craft.BaseElementEditor.extend(
showImageEditor: function()
{
new Craft.AssetImageEditor(this.$element.data('id'), {
onSave: $.proxy(this, 'reloadForm'),
onSave: function () {
this.reloadIndex = true;
this.reloadForm();
}.bind(this),
allowDegreeFractions: Craft.isImagick
});
}
},

onHideHud: function () {
if (this.reloadIndex && this.settings.elementIndex) {
this.settings.elementIndex.updateElements();
}

this.base();
}
});

// Register it!
Expand Down
1 change: 1 addition & 0 deletions src/web/assets/cp/src/js/BaseElementEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ Craft.BaseElementEditor = Garnish.Base.extend(
siteId: null,
attributes: null,
params: null,
elementIndex: null,

onShowHud: $.noop,
onHideHud: $.noop,
Expand Down
4 changes: 3 additions & 1 deletion src/web/assets/cp/src/js/BaseElementIndexView.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
},

createElementEditor: function($element) {
Craft.createElementEditor(this.elementIndex.elementType, $element);
Craft.createElementEditor(this.elementIndex.elementType, $element, {
elementIndex: this.elementIndex
});
},

disable: function() {
Expand Down
3 changes: 2 additions & 1 deletion src/web/assets/cp/src/js/TableElementIndexView.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ Craft.TableElementIndexView = Craft.BaseElementIndexView.extend(
if (response.tableAttributes) {
this._updateTableAttributes($element, response.tableAttributes);
}
}, this)
}, this),
elementIndex: this.elementIndex
});
},

Expand Down

0 comments on commit 78c9dea

Please sign in to comment.