setting the "top" css value for a modal window

setting the "top" css value for a modal window

av Patrick Scott -
Antall svar: 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

Gjennomsnittlig vurdering: -
Som svar til Patrick Scott

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

av Mark Johnson -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av 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.

Gjennomsnittlig vurdering:Useful (1)