function Controller(){function e(){d.toggleMenu(a.standings,Alloy.Globals.animations.menu)}function t(){d.toggleMenu(a.filterTable,Alloy.Globals.animations.filterMenu)}function i(){if(Alloy.Globals.dataValidCompetitions){var e=[];_.each(Alloy.Globals.competitions,function(t){if(t.activeSeasonHasTable){var i=Alloy.createController("filterTableRow",{id:t.competitionId,title:t.competitionName,type:"competition"}).getView();e.push(i)}}),a.filterTable.data=e}else setTimeout(i,300)}function l(e){d.is("filter menu e",e),n({id:e.row.competitionId})}function n(e){void 0!==s&&s===e.id?d.toggleMenu(a.filterTable,Alloy.Globals.animations.filterMenu):(d.i("changing filter ["+e.sectionId+"]"),Alloy.Globals.loading.showHide("show"),a.table.getStandings(e.id),a.table.table.scrollToIndex(0),d.toggleMenu(a.filterTable,Alloy.Globals.animations.filterMenu))}require("alloy/controllers/BaseController").apply(this,Array.prototype.slice.call(arguments)),this.__controllerPath="standings",arguments[0]?arguments[0].__parentSymbol:null,arguments[0]?arguments[0].$model:null,arguments[0]?arguments[0].__itemTemplate:null;var a=this,o={},r={};a.__views.standings=Ti.UI.createView({backgroundColor:Alloy.CFG.colors.darkBlue,layout:"vertical",id:"standings"}),a.__views.standings&&a.addTopLevelView(a.__views.standings),a.__views.titleBar=Ti.UI.createView({height:40,top:0,id:"titleBar"}),a.__views.standings.add(a.__views.titleBar),a.__views.menuButton=Ti.UI.createView({width:33,height:33,left:12,backgroundImage:"images/iconMenu.png",id:"menuButton"}),a.__views.titleBar.add(a.__views.menuButton),e?a.__views.menuButton.addEventListener("click",e):r["$.__views.menuButton!click!toggleMenu"]=!0,a.__views.title=Ti.UI.createLabel({font:{fontSize:20,fontFamily:Alloy.CFG.fonts.bold},color:Alloy.CFG.colors.white,text:L("Tables_Title"),id:"title"}),a.__views.titleBar.add(a.__views.title),a.__views.filterButton=Ti.UI.createView({width:33,height:33,right:12,backgroundImage:"images/iconFilter.png",id:"filterButton"}),a.__views.titleBar.add(a.__views.filterButton),t?a.__views.filterButton.addEventListener("click",t):r["$.__views.filterButton!click!toggleFilterMenu"]=!0,a.__views.tableWrapper=Ti.UI.createView({id:"tableWrapper"}),a.__views.standings.add(a.__views.tableWrapper),a.__views.table=Alloy.createController("standingsTable",{id:"table",__parentSymbol:a.__views.tableWrapper}),a.__views.table.setParent(a.__views.tableWrapper),a.__views.filterTable=Ti.UI.createTableView({separatorColor:Alloy.CFG.colors.darkGrey,backgroundColor:"transparent",height:420,top:-420,id:"filterTable"}),a.__views.tableWrapper.add(a.__views.filterTable),l?a.__views.filterTable.addEventListener("click",l):r["$.__views.filterTable!click!filterMenuClicked"]=!0,o.destroy=function(){},_.extend(a,a.__views);var s,d=require("helpers");a.table.getStandings(Alloy.Globals.competitions[0].competitionId),i(),r["$.__views.menuButton!click!toggleMenu"]&&a.__views.menuButton.addEventListener("click",e),r["$.__views.filterButton!click!toggleFilterMenu"]&&a.__views.filterButton.addEventListener("click",t),r["$.__views.filterTable!click!filterMenuClicked"]&&a.__views.filterTable.addEventListener("click",l),_.extend(a,o)}var Alloy=require("alloy"),Backbone=Alloy.Backbone,_=Alloy._;module.exports=Controller;