43 lines
1.0 KiB
JavaScript
43 lines
1.0 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'a0ce5CPYtlF5oYo82Sd7K4h', 'cmp.servers.area.item');
|
|
// Scripts/mod/login/cmp/cmp.servers.area.item.js
|
|
|
|
"use strict";
|
|
|
|
/******************************************************************
|
|
*
|
|
* 服务器大区项
|
|
*
|
|
******************************************************************/
|
|
|
|
var SvcItem = require("nx.fx.sv.expand.item");
|
|
cc.Class({
|
|
"extends": SvcItem,
|
|
properties: {},
|
|
// 数据重置
|
|
rebind: function rebind(_idx, _data, _key) {
|
|
this._super(_idx, _data, _key);
|
|
|
|
// 刷新
|
|
this.fresh();
|
|
},
|
|
// 聚焦获得
|
|
onFocus: function onFocus() {
|
|
nx.gui.setActive(this, "on", true);
|
|
nx.gui.setActive(this, "off", false);
|
|
},
|
|
// 聚焦失去
|
|
outFocus: function outFocus() {
|
|
nx.gui.setActive(this, "on", false);
|
|
nx.gui.setActive(this, "off", true);
|
|
},
|
|
// 刷新
|
|
fresh: function fresh() {
|
|
this.outFocus();
|
|
var txt = nx.text.getKey(this.mdata.name);
|
|
nx.gui.setString(this, "off/txt", txt);
|
|
nx.gui.setString(this, "on/txt", txt);
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |