MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / unbind

Method unbind

src/common/overlay/levelRenderer/Eventful.js:112–139  ·  view source on GitHub ↗

* @function LevelRenderer.Eventful.prototype.unbind * @description 解绑事件。 * @param {string} event - 事件名。 * @param {boolean} handler - 响应函数。 * @returns {LevelRenderer.Eventful} this

(event, handler)

Source from the content-addressed store, hash-verified

110 * @returns {LevelRenderer.Eventful} this
111 */
112 unbind(event, handler) {
113 var _h = this._handlers;
114
115 if (!event) {
116 this._handlers = {};
117 return this;
118 }
119
120 if (handler) {
121 if (_h[event]) {
122 var newList = [];
123 for (var i = 0, l = _h[event].length; i < l; i++) {
124 if (_h[event][i]['h'] != handler) {
125 newList.push(_h[event][i]);
126 }
127 }
128 _h[event] = newList;
129 }
130
131 if (_h[event] && _h[event].length === 0) {
132 delete _h[event];
133 }
134 } else {
135 delete _h[event];
136 }
137
138 return this;
139 }
140
141
142 /**

Callers 3

jquery.jsFile · 0.80
unMethod · 0.80
hideRightMenuFunction · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected