message: Update notification in sidebar
diff: @@ -13,6 +13,7 @@ import { View } from './view';
  import { Account } from '../controllers/auth';
  import { ContextMenu, ContextMenuItemType } from '../helpers/contextmenu';
  import { PowerBiSignin } from './powerbi-signin';
  +import { ApplicationUpdateAvailableWebMessage, WebMessageType } from '../model/message';
  export class Sidebar extends View {
  static DEFAULT_USER_PICTURE = "images/user.svg";
  @@ -20,6 +21,7 @@ export class Sidebar extends View {
  items: Dic<string> = {};
  currentItem: string;
  collapsed = false;
  + ctrlOptions: HTMLElement;
  constructor(id: string, container: HTMLElement, items: Dic<string>) {
  super(id, container);
  @@ -42,7 +44,7 @@ export class Sidebar extends View {
  `).join("")}
  </div>
  <footer>
  - <div id="ctrl-options" class="ctrl icon-options solo" title="${i18n(strings.settingsCtrlTitle)}"></div>
  + <div id="ctrl-options" class="ctrl icon-options solo" title="${i18n(strings.settingsCtrlTitle)}"><div class="notification">1</div></div>
  <div id="ctrl-theme" class="ctrl icon-theme-${optionsController.options.theme.toLowerCase()} solo hide-if-collapsed" title="${i18n(strings.themeCtrlTitle)}" data-theme="${optionsController.options.theme}"></div>
  @@ -52,6 +54,8 @@ export class Sidebar extends View {
  `;
  this.element.insertAdjacentHTML("beforeend", html);
  + this.ctrlOptions = _("#ctrl-options", this.element);
  +
  //Select first item
  for (id in this.items) {
  this.select(id);
  @@ -62,6 +66,13 @@ export class Sidebar extends View {
  }
  listen() {
  +
  + host.on(WebMessageType.ApplicationUpdate, (data: ApplicationUpdateAvailableWebMessage)=>{
  + window.setTimeout(()=>{
  + this.toggleUpdateNotification(true);
  + }, 5000);
  + });
  +
  __(`.side-menu .item`, this.element).forEach(div => {
  div.addEventListener("click", (e) => {
  @@ -143,6 +154,11 @@ export class Sidebar extends View {
  auth.on("signedOut", () => {
  this.changeProfilePicture(i18n(strings.signInCtrlTitle));
  });
  +
  + this.ctrlOptions.addEventListener("click", e => {
  + e.preventDefault();
  + //TODO
  + });
  }
  changeProfilePicture(title: string, picture?: string) {
  @@ -182,4 +198,16 @@ export class Sidebar extends View {
  this.collapsed = collapse;
  }
  + toggleUpdateNotification(toggle: boolean) {
  +
  + let notificationElement = _(".notification", this.ctrlOptions);
  + if (toggle) {
  + notificationElement.classList.add("visible");
  + this.ctrlOptions.setAttribute("title", i18n(strings.settingsPlusUpdateCtrlTitle));
  + } else {
  + notificationElement.classList.remove("visible");
  + this.ctrlOptions.setAttribute("title", i18n(strings.settingsPlusUpdateCtrlTitle));
  + }
  + }
  +
  }
  \ No newline at end of file
  