var ResultList = function (parent, id) { this.Self = $(id); this.Parent = parent; this.ResultData = null; this.DisableSwitch = false; this.PlayControl = new PlayControl(this.Parent, this.Self); this.Startup = function () { this.PlayControl.Startup(); this.EnableTimeList(); this.Self.find('.clac-title span').on('click', this.OnTabHeaderClick.bind(this)); this.Self.find('.switch:first').on('click', this.OnSwitchChanged.bind(this)); }; this.Reset = function () { this.Self.find('.switch:first').removeClass('switch-on'); this.Self.find('.backward-time-list:first').empty(); this.Self.find('.forward-time-list:first').empty(); this.ShowMask(); }; this.SetData = function (layerName, centerPoint, resultData) { this.LayerName = layerName; this.CenterPoint = { Latitude: centerPoint[0], Longitude: centerPoint[1] }; this.ResultData = resultData; this.ResetTimeList(this.Self.find('.backward-time-list:first'), resultData.backward.points); this.ResetTimeList(this.Self.find('.forward-time-list:first'), resultData.forward.points); }; this.OnTabHeaderClick = function (event) { // Toogle tab header this.Self.find('.clac-title span').removeClass("active"); $(event.target).addClass("active"); // Toogle time list var type = this.GetResultType(); this.Self.find('.backward-time-list').css('display', type === 'backward' ? '' : 'none'); this.Self.find('.forward-time-list').css('display', type === 'forward' ? '' : 'none'); // Load detail data this.LoadDetailData(); this.SetCurrentTimeList(); }; this.OnSwitchChanged = function () { this.Self.find('.switch:first').toggleClass('switch-on'); this.EnableTimeList(); this.SetCurrentTimeList(); }; this.SetCurrentTimeList = function () { this.PlayControl.OnPauseButtonClick(); var type = this.GetResultType(); this.PlayControl.CurrentTimeList = this.Self.find('.{0}-time-list:first'.format(type)); }; this.ResetTimeList = function (list, points) { list.empty(); points.forEach(function (point) { var time = moment(point[2], "YYYYMMDD_HHmmss"); var label = "