Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/AEMaaCS/develop' into AEMaaCS/de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
mheil committed Mar 21, 2024
2 parents 6447965 + b33cc1f commit a199af3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

// is needed for IE9 compatibility
var opt = this.$element.get()[0];

if (!opt) {
throw new Error('Controlled error thrown on purpose!');
}

// get config properties
this.itemDialog = (options.mergeroot || opt.getAttribute('data-mergeroot') || '/mnt/override') + (options.itemdialog || opt.getAttribute('data-itemdialog'));
this.itemStorageNode = options.itemstoragenode || opt.getAttribute('data-itemstoragenode') || "items";
Expand All @@ -40,6 +45,7 @@
this.minElements = options.minelements || opt.getAttribute('data-minelements');
this.maxElements = options.maxelements || opt.getAttribute('data-maxelements');
this.readOnly = options.renderreadonly || opt.getAttribute('data-renderreadonly');
this.smallScreen = options.smallScreen || false;

// get the crx path of the current component from action attribute of the current form.
this.crxPath = this.$element.parents("form").attr("action");
Expand All @@ -49,13 +55,27 @@
// add the "+" button for adding new items
$(".coral-SpectrumMultiField-add", this.$element).attr("disabled", "disabled");
} else {
this._checkAndReinitializeForSmallerScreens();
// add button listeners
this._addListeners();
}
// get list elements
this._updateList(false);
},

/**
* Special handling for tablet and smaller viewports
*
* @private
*/
_checkAndReinitializeForSmallerScreens: function () {
if (window.innerWidth < 1024) {
$(document).one('foundation-contentloaded', function (e) {
$(e.target).find('.coral-Form-field.coral-GenericMultiField').each(function () {
new Merkle.GenericMultiField();
});
});
}
},
/**
* Performs an ajax call to the storage node and updates the list entries.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@
* @private
*/
function _getDomElementForDialog(dialog) {

var cqDialogForm;
if (dialog.getConfig().itemPath) {
cqDialogForm = ns.Helper.findDialog(dialog.getConfig().itemPath);
Expand Down

0 comments on commit a199af3

Please sign in to comment.