Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic take a div containing the Canvas and make it Fullscreen (Read 2067 times)
agelospanagiotakis
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 27th, 2007
take a div containing the Canvas and make it Fullscreen
Jul 13th, 2014 at 9:16am
Print Post  
Is there any way to take a div containing the mindfusion canvas and make it Fullscreen so that the user can only work on the diagram for a while and then return to the attach it back to a div when done ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: take a div containing the Canvas and make it Fullscreen
Reply #1 - Jul 14th, 2014 at 8:03am
Print Post  
Try the following
Code
Select All
function fullScreen()
{
	var parentDiv = document.getElementById("view");
	var diagram = MindFusion.Diagramming.Diagram.find("diagram");

	if (enterFullScreen(parentDiv))
	{
		var docWidth = diagram.clientToDocLength(screen.width);
		var docHeight = diagram.clientToDocLength(screen.height);
		var bounds = diagram.getBounds().clone();
		if (bounds.width < docWidth || bounds.height < docHeight)
		{
			bounds.width = docWidth;
			bounds.height = docHeight;
			diagram.setBounds(bounds);
		}
	}
}

function enterFullScreen(element)
{
	if (element.requestFullscreen)
	{
		element.requestFullscreen();
		return true;
	}
	if (element.msRequestFullscreen)
	{
		element.msRequestFullscreen();
		return true;
	}
	if (element.mozRequestFullScreen)
	{
		element.mozRequestFullScreen();
		return true;
	}
	if (element.webkitRequestFullscreen)
	{
		element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
		return true;
	}

	return false;
} 



Check this MDN topic for a list of supported browsers:
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mod...

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint