JSFiddle - React, Tailwind, and code Playground
HTML
<button>Show Panel</button>
JavaScript
YUI({filter: 'raw'}).use('panel', function (Y) {
var clicked;
var panel = new Y.Panel({
visible: false,
render : true,
on : {
contentUpdate: function () {
Y.log('panel\'s content updated');
}
}
}),
buttons = [
{
value : 'Yes',
section: 'footer',
action : function (e) {
e.preventDefault();
Y.log('clicked yes');
panel.hide();
}
},
{
value : 'No',
section: 'footer',
action : function (e) {
e.preventDefault();
Y.log('clicked no');
clicked = true;
panel.hide();
}
}
];
function showPanel() {
panel.set('bodyContent', 'Some question.');
panel.set('buttons', buttons);
if(clicked) panel.set('buttons', []);
panel.show();
}
Y.one('body').addClass('yui3-skin-sam');
Y.one('button').on('click', showPanel);
});