Hi! I found the info about how to customize PropertyPanel with user buttons.
Unfortunatelly, the example shows only the basic staff - how to add a simple button and how to add event listener to it.
But I saw some pictures, where developers add buttons with images, and even another controls, such as checkboxes, text inputs and delimiters.
Does onpremise Confluence support this functionality?
Solve it.
The correct answer is:
AJS.Confluence.PropertyPanel.Macro.registerInitHandler
buttons[1].html = '<input type="text" />';Or, you can even insert new buttons structure into array.
$(window).on('created.property-panel', function () { //work with DOM controls here });
Summary function code could look like this:
AJS.Confluence.PropertyPanel.Macro.registerInitHandler(function(macroPlaceholder, buttons) { //Make what you want with the buttons array. Add or set 'html' property to any custom html you want. buttons[1].html = '<input id="PropertyPanelCustomInput" type="text" />'; $(window).once('created.property-panel', function () { //Add any event handlers to you custom controls here $('PropertyPanelCustomInput').on('change', function() { //Yeah, great. Now I know how to do that! }); }); }, 'myplugin');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.