Skip to content

Commit

Permalink
XWIKI-22814: Regression on the Dashboard buttons layout when there's …
Browse files Browse the repository at this point in the history
…a warning message (#3835)

* Fixed the layout construction to make sure everything is fine if there's a warning box.
* Removed typos

(cherry picked from commit 023144d)
  • Loading branch information
Sereza7 authored and michitux committed Jan 24, 2025
1 parent a206731 commit b71e6d2
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,18 @@ XWiki.Dashboard = Class.create( {
// find out all the gadget-containers in element and add them ids
this.containers = element.select(".gadget-container");
this.createDragAndDrops();
this.addGadgetsHandlers();``
this.addGadgetsHandlers();
// Create the section to contain add buttons
var sectionAddButtons = new Element('section', {
'class': 'containeradd'
})
this.element.insert({'top' : sectionAddButtons});
});
// check if the warning is there, if it is, put the button under it
var warning = this.element.down('.differentsource');
if (warning) {
warning.insert({'after' : sectionAddButtons});
} else {
this.element.insert({'top' : sectionAddButtons});
}
this.addNewGadgetHandler();
this.addNewContainerHandler();

Expand Down Expand Up @@ -295,13 +301,7 @@ XWiki.Dashboard = Class.create( {
});
addButton.update(icons.add + l10n['dashboard.actions.add.button']);
addButton.observe('click', this.onAddGadgetClick.bindAsEventListener(this));
// check if the warning is there, if it is, put the button under it
var warning = this.element.down('.differentsource');
if (warning) {
warning.insert({'after' : addButton});
} else {
this.element.down('.containeradd').insert(addButton);
}
this.element.down('.containeradd').insert(addButton);
},

/**
Expand Down

0 comments on commit b71e6d2

Please sign in to comment.