summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/theming/lib/IconBuilder.php7
-rw-r--r--core/js/oc-dialogs.js16
2 files changed, 21 insertions, 2 deletions
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index 205ee3a89a0..39a7722f0a5 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -159,7 +159,12 @@ class IconBuilder {
$finalIconFile->setImageArtifact('compose:args', "1,0,-0.5,0.5");
$finalIconFile->compositeImage($appIconFile, Imagick::COMPOSITE_ATOP, $offset_w, $offset_h);
$finalIconFile->setImageFormat('png24');
- $finalIconFile->resizeImage($size, $size, Imagick::INTERPOLATE_BICUBIC, 1, false);
+ if (defined("Imagick::INTERPOLATE_BICUBIC") === true) {
+ $filter = Imagick::INTERPOLATE_BICUBIC;
+ } else {
+ $filter = Imagick::FILTER_LANCZOS;
+ }
+ $finalIconFile->resizeImage($size, $size, $filter, 1, false);
$appIconFile->destroy();
return $finalIconFile;
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 7476c93ba45..7e059b4bbc0 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -124,6 +124,14 @@ var OCdialogs = {
modal = false;
}
$('body').append($dlg);
+
+ // wrap callback in _.once():
+ // only call callback once and not twice (button handler and close
+ // event) but call it for the close event, if ESC or the x is hit
+ if (callback !== undefined) {
+ callback = _.once(callback);
+ }
+
var buttonlist = [{
text : t('core', 'No'),
click: function () {
@@ -147,7 +155,13 @@ var OCdialogs = {
$(dialogId).ocdialog({
closeOnEscape: true,
modal : modal,
- buttons : buttonlist
+ buttons : buttonlist,
+ close : function() {
+ // callback is already fired if Yes/No is clicked directly
+ if (callback !== undefined) {
+ callback(false, input.val());
+ }
+ }
});
input.focus();
OCdialogs.dialogsCounter++;