update web components

This commit is contained in:
Luke Pulverenti 2017-04-15 15:44:40 -04:00
parent 3fd7c3e85c
commit 00e7ae5fb6
25 changed files with 611 additions and 189 deletions

View file

@ -1 +1 @@
define(["browser","appSettings","events"],function(browser,appSettings,events){"use strict";function setLayout(self,layout,selectedLayout){layout===selectedLayout?(self[layout]=!0,document.documentElement.classList.add("layout-"+layout)):(self[layout]=!1,document.documentElement.classList.remove("layout-"+layout))}function LayoutManager(){var self=this;self.setLayout=function(layout,save){layout&&"auto"!==layout?(setLayout(self,"mobile",layout),setLayout(self,"tv",layout),setLayout(self,"desktop",layout),save!==!1&&appSettings.set("layout",layout)):(self.autoLayout(),save!==!1&&appSettings.set("layout","")),events.trigger(self,"modechange")},self.getSavedLayout=function(layout){return appSettings.get("layout")},self.autoLayout=function(){browser.mobile?self.setLayout("mobile",!1):browser.tv||browser.xboxOne?self.setLayout("tv",!1):self.setLayout(self.defaultLayout||"tv",!1)},self.init=function(){var saved=self.getSavedLayout();saved?self.setLayout(saved,!1):self.autoLayout()}}return new LayoutManager});
define(["browser","appSettings","events"],function(browser,appSettings,events){"use strict";function setLayout(self,layout,selectedLayout){layout===selectedLayout?(self[layout]=!0,document.documentElement.classList.add("layout-"+layout)):(self[layout]=!1,document.documentElement.classList.remove("layout-"+layout))}function LayoutManager(){}return LayoutManager.prototype.setLayout=function(layout,save){layout&&"auto"!==layout?(setLayout(this,"mobile",layout),setLayout(this,"tv",layout),setLayout(this,"desktop",layout),save!==!1&&appSettings.set("layout",layout)):(this.autoLayout(),save!==!1&&appSettings.set("layout","")),events.trigger(this,"modechange")},LayoutManager.prototype.getSavedLayout=function(layout){return appSettings.get("layout")},LayoutManager.prototype.autoLayout=function(){browser.mobile?this.setLayout("mobile",!1):browser.tv||browser.xboxOne?this.setLayout("tv",!1):this.setLayout(this.defaultLayout||"tv",!1)},LayoutManager.prototype.init=function(){var saved=this.getSavedLayout();saved?this.setLayout(saved,!1):this.autoLayout()},new LayoutManager});