setting the "top" css value for a modal window

setting the "top" css value for a modal window

by Patrick Scott -
Number of replies: 1

hi

I've created a modal window and I'm tying to set it's "top" and "left" values.
this is the code:

Y.use('moodle-core-notification-dialogue', function() {
	panel = new M.core.dialogue({
		draggable: true,
		modal: true,
		closeButton: true,
		responsive: true,
	});
	panel.set('bodyContent', 'my test content');
	//panel.set('top', '10px');

	panel.show();
});

I would like to do something like the "panel.set('top', '10px');" in order do so. how can it be done?

I have moodle 3.5.1 installed

Average of ratings: -
In reply to Patrick Scott

Re: setting the "top" css value for a modal window

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Patrick, The example you have followed is using the deprecated YUI framework. The current way to create modal dialogues in Moodle using using the AMD Modal modal.

One possible solution would be inside the done method for your AMD Modal, you could do modal.style.top = '10px'; or modal.css('top', '10px') if its a jquery object.

Average of ratings:Useful (1)