tab iframe zimlet without overview area on the left?

Interested in talking about Mash-up's? This is the place.
Post Reply
User avatar
Tom Welter
Posts: 9
Joined: Sat Sep 13, 2014 3:32 am

tab iframe zimlet without overview area on the left?

Post by Tom Welter »

Hi all,
I have installed the tab iframe zimlet (https://wiki.zimbra.com/wiki/ZCS_6.0:Zi ... Tab_iFrame) which works well.

However, I would like the iframe to take the full page width available, that is, without the overview area and calendar on the left. I think I must add something to the zimlet .js file but so far I have not figured out what.

I found this below but it does not work, only blocks the calendar from display although the space it would take is still there.
It is pasted in

Code: Select all

 com_zimbra_elgg_tabiframe_HandlerObject.prototype.appActive =
function(appName, active)

Code: Select all

if (active)
   {
      //In the ownCloud Zimbra tab hide the left menu bar that is displayed by default in Zimbra, also hide the mini calendar
      document.getElementById('z_sash').style.display = "none";   
      //Users that click the ownCloud tab directly after logging in, will still be served with the calendar, as it is normal
      //it takes some time to be displayed, so if that occurs, try to remove the calender again after 10 seconds.
      try {
         var cal = document.getElementsByClassName("DwtCalendar");
         cal[0].style.display = "none";
      } catch (err) { setTimeout(function(){var cal = document.getElementsByClassName("DwtCalendar"); if(cal[0]){cal[0].style.display = "none";}}, 10000); }
   }
   else
   {
      document.getElementById('z_sash').style.display = "block";
      try {
         var cal = document.getElementsByClassName("DwtCalendar");
         cal[0].style.display = "block";
      } catch (err) { }
   }
   
regards
Tom
brick__
Posts: 11
Joined: Tue May 17, 2016 3:28 pm

Re: tab iframe zimlet without overview area on the left?

Post by brick__ »

Hello Tom,

First of all, I'm not a member of Zimbra or related to it in any way. I just happen to be working on it, and had the exact same need a few weeks ago.

The solution that I found best was to use the methods present in the ZmSkin.js file that you can find in the skins folder in the base skin(available in the original repo here).

You can get all the container's ids for the tree part with the hints (i.e. window.skin.hints.tree), and there's a show() and hide() public method.
You can get the skin object back from the window global variable so it looks something like this:

Code: Select all

window.skin.hide("tree", false);
The method actually gets the containers from the element you feed to it.

Hope this helps.
User avatar
Tom Welter
Posts: 9
Joined: Sat Sep 13, 2014 3:32 am

Re: tab iframe zimlet without overview area on the left?

Post by Tom Welter »

Hi brick

Thanks for the answer, just the kind of answer i was looking for. However, your suggestion works but not always. It works the first time after zimlet deployment, sometimes it switches to full width after a few seconds , sometimes not at all, but it always works when I switch windows with alt-tab or when I resize the browser window (firefoz linux). Any suggestions?

I included the following in the .js file of the zimlet

Code: Select all

com_zimbra_elgg_tabiframe_HandlerObject.prototype.appActive =
function(appName, active) {
	
	switch (appName) {
		case this._simpleAppName: {
		
			var app = appCtxt.getApp(appName); // get access to ZmZimletApp

			break;
		}
	}
    window.skin.hide("tree", true);
};
regards
Tom
brick__
Posts: 11
Joined: Tue May 17, 2016 3:28 pm

Re: tab iframe zimlet without overview area on the left?

Post by brick__ »

Hello Tom,

I think it might come from the second parameter your hide(name, noReflow) function takes. The noReflow argument triggers the _reflowApp() function if it is false (because of the double negation). I don't know why it is done this way, probably because it is easier to use in the grand scheme of things.

So in your case you actually prevent it to refresh the app to show the changes since you set it to true.

Hope this solves your problem.
User avatar
Tom Welter
Posts: 9
Joined: Sat Sep 13, 2014 3:32 am

Re: tab iframe zimlet without overview area on the left?

Post by Tom Welter »

Hi brick

Thanks! simple and works perfect.

Code: Select all

window.skin.hide("tree", false);
did the trick. I misunderstood the meaning of the boolean value :oops:

regards,
Tom
Post Reply