This documentation relates to an earlier version of Atlassian Gadgets.
View

Unknown macro: {spacejump}

or visit the current documentation home.

This page is part of the Gadget Developers' JavaScript Cookbook.

How do I dynamically theme my gadget?

It is possible to have the theme dynamically adapt to the space available with some JavaScript like this:

action: ...
theme : function () {
  if (gadgets.window.getViewportDimensions().width < 500){
    return "top-label";
  } else{
    return "long-label";
  }
}(),
fields: ...

関連トピック

Gadget Developers' JavaScript Cookbook
Using the Atlassian Gadgets JavaScript Framework

  • ラベルなし