Tea.context(function () { var that = this; this.success = NotifyPopup this.selectedType = this.scheduling.code; this.schedulingTypeDescription = null; this.changeSchedulingType = function () { this.schedulingTypeDescription = this.schedulingTypes.$find(function (k, v) { return v.code == that.selectedType; }).description; }; this.changeSchedulingType(); // hash this.hashKey = ""; this.hashVar = ""; if (this.scheduling.code == "hash") { this.hashKey = this.scheduling.options.key; } else { this.hashKey = "${remoteAddr}"; } this.changeHashVar = function () { if (this.hashVar.length > 0) { this.hashKey = this.hashVar; } }; // sticky if (this.scheduling.code == "sticky") { this.stickyType = this.scheduling.options.type; this.stickyParam = this.scheduling.options.param; } else { this.stickyType = "cookie"; this.stickyParam = "Origin"; } });